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 dialogue, tick True and click OK.
Additional information
Discuss this article... Feedback Forum
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
Related links
Results 1-3 of 41
Trending Articles
Results 1-3 of 50