18 August 2023
Allowing users to filter views to show the top or bottom N values is a common requirement in Tableau. Using parameters makes this flexible for end users.
In this article, you'll learn how to create Top N parameters in Tableau Desktop to dynamically rank and filter data. This article is part of our on-going blog series of useful 'how-to' guide in Tableau. The material from JBI Trainings is part of our tableau courses which can be accessed remotely or in person in London. Simply follow the link to participate in the training for you or your team. Tableau Training London
Giving dashboard users the ability to specify the number of top/bottom rows they want to see is extremely valuable for analytics.
For example, your executives may want to:
By creating a Top N parameter, you can enable this flexible filtering without complex calculations.
We'll walk through how to set up ranking params using different Tableau techniques. Let's get started!
The easiest way is to base your parameter on the Top N Filter.
Now users can change the parameter to rank top and bottom values dynamically.
You can allow additional configurations like:
For more flexibility, base your parameter on a table calculation rank measure.
Table calculations allow custom rank logic like handling ties or percentages.
For large data sets, use a level of detail (LOD) expression to optimize performance.
TOPNbased on a parameter.
LODs lead to fast ranking with live connection flexibility.
Exposing a parameter makes it easy for consumers to:
Careful parameter design provides user flexibility without complex data manipulation.
To recap, you can enable top and bottom filtering in Tableau with:
Top N parameters create interactive dashboards for data analysis. Users gain insights by dynamically ranking and filtering data.
Now you have the skills to build flexible top and bottom filtering in Tableau!