This content has been marked as final.
Show 1 reply

1. Re: Counting elements of an aggregated field
Joe Mako Nov 20, 2011 10:58 AM (in response to Daniel Thull)What you can do is use a calc field like:
IF FIRST()==0 THEN WINDOW_SUM(AVG(1),0,IIF(FIRST()==0,LAST(),0)) END
with its compute using set to Brand, and then from the rightclick context menu on your bin calculation pill, uncheck the Ignore in Table Calculations option. This will cause partitioning on this field for all table calculations on this sheet.
Also you can simplify your bin calculation to:
IF SUM([sales]) <= 100 THEN "<100k" ELSEIF SUM([sales])<=500 THEN "500k" ELSEIF SUM([sales])<=1000 THEN "1000k" ELSE "1000k +" END
less conditional tests will evaluate quicker, because for an IF/ELSEIF/ELSE statement, Tableau matches on the first True result.
attached is an example.

revenue_band_test_jm_edit.twbx 13.0 KB
