Last Modified Date: 29 Mar 2023
Environment
- Tableau Desktop
Answer
The attached example workbook uses the example data set Superstore to demonstrate the following instructions:
-
Create a calculated field with a name like "Top & Bottom N Filter" with a calculation similar to the following:
RANK( SUM( [Sales] ), 'desc' ) <= [N Parameter]
OR
RANK( SUM( [Sales] ), 'asc' ) <= [N Parameter]
The above calculation returns a value of true if SUM( [Sales] ) is the highest N ranking sub-categories for either largest first or smallest first.
-
Drag Top & Bottom N Filter to the Filters shelf and click OK to close the Filter dialog.
-
Right-click Top & Bottom N Filter on the Filters shelf and select Compute using > Pane (Down).
-
In the Filter dialog, check True and click OK.
Additional Information
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials