The Following Example is showing Cities If % of total is Less than 10 then "Other" else [City].
I have created a calculated field to get the % of total.
sum([Sales]) / window_sum(sum([Sales]))*100
Then I create following Calculated field to get the Customized Field.
if [Sales % of total]<10.00 then attr("Other") else attr([City]) end
You hit a nail with this seemingly "simple" task.
NOT using sets you've left with a decent choice,
which is using mainly table calculations.
Though basic calculations looks rather simple both ways,
but the table calc approach needs a mastery when dealing with Totals.
Yep, you got it correct. To get as simple as 100% Grand Total,
one need to write an overly complicated conditional logic into a table calc.
Moreover, trying to accomplish this, I used TD version 8.3.2
Then I simply re-write my calcs into version 8.1.16 workbook, and guess what?
Grand Totals again became (and stay) as messy as before :-(
So I attach both 8.1.16 and 8.3.2 versions here.
If anybody interest in the subject, please welcome :-)
1 of 1 people found this helpful
Playing with the mystery of scrambling Totals
in version 8.1.16 of the wb (Book1.twbx above),
I found that if one simply flip table calc Total
from Auto to Hide -- and then back to Auto --
everything went OK with Grand Totals on the view :-)
Digging deeper, I found that one simple property change
make this happen, namely:
caption='% of total sales'
Voila, with this bold piece of code
added to the field definition in XML code of Book1.twb
Totals went to the expected behaviour on the view.
Yuri - Thank you very much!! I have been struggling with this for a while and this was a good solution.
Something for the Tableau team to think about making easier... Seems like a pretty standard requirement.
wow, this really does appear to be way more complicated than it should be.