Last modified date: 17 Oct 2022
Environment
Tableau DesktopResolution
To control the order in which the Top N filters are executed, you can make use of:- Context filters
- Level of detail expressions
- Table calculations
Step 1: Create the View
- Place Region, Category and Sub-Category on Rows
- Place SUM(Sales) on Text
- Select Analysis > Create Calculated Field. Name the field Rank of Sales, enter the following calculation, then click OK:
RANK( SUM( [Sales] ) )
- Select Analysis > Create Calculated Field. Name the field Rank of Sales excluding Sub-Category, enter the following calculation, then click OK:
RANK_DENSE( SUM( { EXCLUDE [Sub-Category] : SUM( [Sales] ) } ) )
Step 3: Set up Filters
- Drag Rank of Sales excluding Sub-Category to Filters and click OK.
- Right-click Rank of Sales excluding Sub-Category on Filters and select Edit Table Calculation…
- In the Table Calculation dialog, select Compute Using > Specific Dimensions.
- Arrange Region, Category and Sub-Category in descending order, then select the check boxes next to all three fields.
- Under Restarting every, select Region.
- Right-click Rank of Sales Excluding Sub Category on the Filters shelf and select Edit Filter...
- In the Filter dialog, enter the desired limits. For example, enter a range of 1 to 2 to display the top two Categories in each Region.
- Drag Rank of Sales to Filters, and click OK.
- Right-click Rank of Sales on Filters and select Edit Table Calculation…
- In the Table Calculation dialog, select Compute Using > Specific Dimensions.
- Arrange Region, Category and Sub-Category in descending order, then select the check boxes next to all three fields.
- Under Restarting every, select Category.
- Right-click Rank of Sales on Filters, and select Edit Filter.
- Enter the desired limits.
Cause
The multiple Top N filters are executed together with the AND logical operator.Additional information
For more information about this topic, see the following pages: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 677
Trending Articles
Results 1-3 of 677