Here is my suggestion
1. create a parameter of type float
2. create a set on your dimension, fill the condition with a formula like this one : calculation < than parameter
3. create a calculation on your set: if "set" then 'other' else your_dimension
4. put the calculation on your pie chart
Thanks for the effort!
This is not exactly what I need. With this you calculate the % of the category based on the total and then filter each category if it's under a threshold, but what i need is something like doing a rank based on percent and then a running total and when the running total reaches 0.9 (90%) all the remaining accounts are dump to the OTHERS category.
I can do this in a text table, but not in a pie because the table calculations used.
It might help if you post the table you're describing, I'm not quite understanding. In general the way to do table calcs on hidden series is to put the dimension you want to run along on the Detail shelf, aggregate all marks to a single result using a window aggregation, and then filter to one mark per category using the INDEX() function.
I made a simple DS as a playground, attached. Want the last 2 categories in the "OTHER" but not because they are the last 2 but because the running sum of the percentage is less than 0.9.
PIE.twbx 25.9 KB
This is a tricky one. The biggest problem, as I see it, is that you need a running sum in order to make this work. You can do that in table form.
The table calcs have to be set up to compute using Category with a custom sort on SUM(Value) descending.
But all of this hinges on having row level data for each category. When you try to plot this on a pie chart, it falls apart because it must compute using Category, but if you put category on Detail, you'll automatically get a slice for each category.
I don't have a solution for this, unfortunately. Just wanted to add my two cents above. Hopefully someone smarter than I am drops in with a clever solution. I think that I would probably be looking at doing this within a data prep stage. It would still be tricky there as well, but I think it might simplify it a bit. Use of custom SQL to pre-calculate the running sum might also be an option.
Yeah, I arrived to the same thing in one of my iterations. Looks like it's not possible to do it in Tableau.