How to create a Set to show Top 3 even when we filter?

Background

In some business scenarios we can come across a requirement where we have to create a set, which will keep showing “Top 3” items even when using a filter. This is possible but requires some clear understanding of how Order of Operations work in Tableau. For example, we can have Departments, and when we filter on Departments to have Top 3 families displayed at all times. Various different dimensions and metrics can be combined to make such a analysis give incredibly useful insights.

Tableau Create Set to show Top N
Tableau Create Set to show Top N

Context Filter Approach

The scenario can be achieved using Context filters. Context filters are a way of simulating a data source filter, but localized to a particular view or views. So, for any given view, the context filter is applied first. Then any other filter acting on that view works as if the data filtered out by the context filter does not exist at all. This is the beauty of a Tableau Context filter and it will continue to return the expected data even we refresh our data. The Context filter will function automatically on the refreshed latest data to return the expected results.

Why Context Filter

Th reason why this method of using Tableau Context Filters will work effectively in our particular business scenario is because the context filter will relocalize our Top N list strictly to data that exists within the Context. Thus giving us the Top N list for that set of criteria. Otherwise without using Context, any filter will scan the entire data set, and create the Top N list, displaying the values that match our filters – hence the original Top N values might disappear as they can be filtered out. Hence it is important to test out our final analysis sheet and dashboard with a few different sets of data before confirming that it is working absolutely robustly.

Tableau Practice Test

The best Tableau practice exams built. Period. Explore definitive practical problems created by brilliant Tableau experts.

Published by Rahul

Comfortably confused :)

Leave a Reply