-
1. Re: Count Distinct Aggregation
Alex Kerin Feb 13, 2012 11:16 AM (in response to John Mogielnicki) -
2. Re: Count Distinct Aggregation
Alex Kerin Feb 13, 2012 3:20 PM (in response to Alex Kerin)Ha, okay, the table calc is simply window_sum(countd([Cat IDs])), but the secret sauce is that we have to be able to use the countd of subcategories in the table calc - we do this by right clicking on the pill and deselecting - see pic. We then compute using this.
-
3. Re: Count Distinct Aggregation
John Mogielnicki Feb 13, 2012 2:50 PM (in response to Alex Kerin)Hey Alex, thanks for the help. I looked at the attached packaged workbook, and it looks like all of the numbers are overlapping. How can I separate them out?
-
4. Re: Count Distinct Aggregation
Alex Kerin Feb 13, 2012 3:19 PM (in response to John Mogielnicki)Wrong book, sorry:
-
5. Re: Count Distinct Aggregation
Ken Patton Feb 13, 2012 6:08 PM (in response to John Mogielnicki)Here's a patch for the more general case of "Cannot aggregate an aggregate..."
I -- and no doubt, others -- have a quick and dirty hack for when we need to Aggregate a COUNTD Calculated Field (or other calculation that is considered Aggregate):
Just either add zero, or multiply by 1. The resulting Calculated Field is not considered an Aggregate, and thence, it is possible to Aggregate it in your viz. It doesn't hurt to Optimize the Extract if dealing with a lot of records with this kind of calculation in it.
-
6. Re: Count Distinct Aggregation
Alex Kerin Feb 13, 2012 6:43 PM (in response to Ken Patton)Nice Ken, thanks for this - I was unaware of this
-
7. Re: Count Distinct Aggregation
Shawn Wallwork Feb 13, 2012 7:27 PM (in response to Ken Patton)Ken I agree with Alex, very nice tip. But I'm also thinking your Bio is missing a bit of specificity... Tableau, right?
--Shawn
-
8. Re: Count Distinct Aggregation
Ken Patton Feb 13, 2012 7:39 PM (in response to Shawn Wallwork)Hi Shawn,
No I'm just a customer.
-
9. Re: Count Distinct Aggregation
Shawn Wallwork Feb 13, 2012 7:44 PM (in response to Ken Patton)Then I'm truly impressed! Glad you jumped in. (And I like the new avatar that just popped up!) Civil War, that's unusual.
--Shawn
Message was edited by: Shawn Wallwork
-
10. Re: Count Distinct Aggregation
John Mogielnicki Feb 15, 2012 11:49 AM (in response to Alex Kerin)Thanks Alex (and Ken and Shawn),
Looks like that works. It was pretty slow for my large dataset but I'm guessing if I optimize the extract that issue will go away. Really appreciate the help.
-
11. Re: Count Distinct Aggregation
Alex Kerin Feb 15, 2012 12:11 PM (in response to John Mogielnicki)You may want to try this instead as the table calculation:
IF FIRST()==0 THEN
window_sum(countd([Category ID]),0,IIF(FIRST()==0,LAST(),0))
END
This limits the number of times the calculation is done - I would be interested if it speeds it up