11 Replies Latest reply on May 23, 2013 2:11 PM by Joshua Milligan

# Group By, Sum By or Count By I need help...

Basically what I am trying to do is count email contacts by week and then group them by the weeks.

Example:

# Times contacts sent per week

1     2     3     4     5     6     7

Week 1       100  20   10     3     0     0     0

Week 2       201  10    5      1     0     0     0

Week 3        40    1     3      0     0     0     0

The above shows that Week 1 100 email addresses were contacted 1x 20 contacted 2x etc.

Data is configured like this.

Campaign Name     Email Address     Date Sent

Product 1               abc@email,com     Week 1

Product 2               abc@email.com     Week 1

Product 3               abc@email.com     Week 1

• ###### 1. Re: Group By, Sum By or Count By I need help...

Brian,

Here is a workbook that shows a possible solution.  It uses a couple of table calculations and those can get a bit tricky.  The workbook contains some inline explanation, but I'd be happy to answer any additional questions you might have!

Regards,

Joshua

• ###### 2. Re: Group By, Sum By or Count By I need help...

Joshua,Thanks I tried to review the workbook but could not open?

• ###### 3. Re: Group By, Sum By or Count By I need help...

Oh, I am in Tableau 7

• ###### 4. Re: Group By, Sum By or Count By I need help...

Oh, okay!  I'll rebuild the example in 7 and re-post.

Regards,

Joshua

• ###### 5. Re: Group By, Sum By or Count By I need help...

Okay, here it is in version 7!

• ###### 6. Re: Group By, Sum By or Count By I need help...

Joshua,

Again thanks for your help, I think you are on the right track but the results are not accurate.  If you see in week 4 there should only be a total of 5 contacts not six.

Brian

Results should be:

• ###### 7. Re: Group By, Sum By or Count By I need help...

Brian,

What are the expected results?  The sample data you originally posted also shows 6.  What exactly counts as a unique contact?

Regards,

Joshua

• ###### 8. Re: Group By, Sum By or Count By I need help...

Joshua,

If you look at the first tab in the WKBK in week 4 there are only 5 instances of the email address susan@abc.com or brian@abc.com.  In the results in final solution it shows 2 email addresses recieving 6 contacts where the expected result should be 2 with 5 contacts.

Thanks.

Brian

• ###### 9. Re: Group By, Sum By or Count By I need help...

Brian,

So, are you expecting this:

where the values are the number of times the email address was contacted?

Regards,

Joshua

• ###### 10. Re: Group By, Sum By or Count By I need help...

Exactly!

• ###### 11. Re: Group By, Sum By or Count By I need help...

Okay, here's the workbook.  I think it works for this data set, but I'm a little concerned that it may have issues with the actual data as there may be a few complexities.  If you run into anything, please let me know and I'll take a look!

Regards,

Joshua