Last Modified Date: 15 Jun 2018
- Tableau Desktop
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]
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.