We always discuss in our articles about new ways and techniques to represent our data in Tableau Software. We also like to believe that we always identify the best methods to easily explore data and highlight the valuable information we need. As we say most of the time, the data sets we have contain a lot of information. Not occasionally Tableau users run into the problem of crowding their views due to cluttered data sets. That is why it is good to remember that Tableau offers us unlimited possibilities to represent and to filter at any time the data we need to reach the desired results. Today we will discuss about Top N% filter that can be applied in our graphs to manage filters easier and finally to improve user experience.
In a previous article we discussed about Top N Set analysis in which we showed how we can build different tops in Tableau. For example, top 10 best employees or top 5 customers depending on the value of their orders. But today we will see how we can filter our data to view a certain percentage of it.
Top N% filter is a feature available in Tableau that allows users to filter and display a certain percentage of their data. To better understand how it works, let’s take an example. Suppose we want to display product categories and their sales value but showing only the first 75% of the recorded values. Instead of crowding filter area in Tableau, we can add a Top N% filter to automatically display the first 25%, 50% or 75% of the values we have in our data set.
Top N% filter also helps end users to explore the data they are looking for more easily. Instead of adding multiple filters, making it difficult to manage, and increasing the complexity of the final view, we can create a single parameter to use based on our needs. Using Top N% filter we have the possibility to filter and display only a certain percentage of the data we are interested in. We can only display the first 5 customers with the highest sales in a certain region, without filtering by their name and without adding the region in the filters section.
Therefore, Top N% filter helps us to display the percentage of data that interests us. Whether we are talking about the first 8 product categories or the first half of the product categories depending on their sales, Top N% filter is a much quicker solution that helps us easily filter the information we want.
Next, we will show you how you can build the Top N% filter and how you can interpret it in your view.
→ In Tableau Desktop, connect to Tableau: Sample-Superstore
Option 1:
→ Create a calculated field with the formula Index() <= Int(Size()/5) (feel free to modify the 5 value with any value, based on how small do you want your subset to be)
→ Add the calculated field to Filters and select True
→ Add any dimension to rows
→ The visualization will be filtered and will only show the first fifth of the dataset (the dimension sorted by default and then will filter the results
Option 2
→ Create a parameter with float data type, percentage format
→ Select Range in Allowable values section
→ Check Minimum = 0, Maximum = 1, Step = 0.25 (if you want the set to be split into 4)
→ Create a calculated field with the formula {Percentile([Sales], parameter created at #1)}
→ Create a calculated field with the formula [Sales] <= [#4 Field]
→ Add the #5 field into Filters and select True
→ Right click on the parameter and select Show Parameter
→ Add Category to columns and Sales to rows
→ You can now select the percentage of the data from the parameter slider
By Andrei Stan
In this Skillpill, you will learn how to create a Parliament Chart in Tableau. A Parliament Chart, or semicircular chart, represents the distribution of parliamentary seats. It is not a standard chart type in Tableau but can be manually created […]
What is a Context? Contexts are used to configure a Job for standard environments within the Software Development Life Cycle, such as Development, Testing, and Production. A Job always runs within a specific context. When a context is selected in […]
In Talend Cloud Management Console (TMC), you can create executable tasks and execution plans, which can be run directly in the Cloud or with a Remote Engine. You need to create an execution plan to allow automated runs in TMC, […]