2 of 2 people found this helpful
There are a few different ways to do 'Top N' in Tableau. The key is that you don't want to filter on [Postal Code], if you want the results to be dynamic (i.e., if the top postal codes are ever going to change).
One option is a table calculation. Make a field called Index with the formula INDEX().
Add the Index pill to the Filters shelf, and set it to 'At Most 15'.
It should happen automatically, but verify that it is set to Compute Using --> Table Down.
Interesting, I assume this only works if the data is sorted first. Not intuitive, but easy enough to accomplish. Thanks :-)
Yes; this is how you'd do it to make a dynamic top 15 by different measures in a crosstab.
If the user clicks a column label to resort the cross tab, the Top 15 would change.
A more common way way to do Top N based on a single measure would be to use Sets:
or a Rank table calculation:
Thank you Branden. This is the Correct Answer and has helped me a lot. Was taught to used Sets in the tutorials but this IINDEX() Filter approach is very useful when Sets does not work well for dynamic filtering.