Context Filters, and why do we need them?

When covering an introduction to Tableau Desktop there was one feature that jumped out that would really have helped if I knew about it before my Data School Application!

Before going into context filters, and when and why to use them, it is really important to understand Tableau's order of operations. It's similar to BODMAS, the order of operations in Maths, which tells us the sequence in which we should solve an expression with multiple operations.

So as we can see here, Context Filters are applied earlier than other filters, and this means that they work independently of any other filters in the work sheet.

So to break this down I want to find the Top 10 Goalscorers from 2019 in each of the Top 5 leagues. This is what the initial graph looks like.

If you only wanted to see only the Top 10 Premier League Goalscorers then you would think you could just filter to Premier League, but this would only return 3. This is because Tableau is looking for any Premier League Goalscorers WITHIN the Top 10 in Euorpe.

To stop this, we want the League filter to be applied BEFORE the Top 10 filter, which means turning it into a context filter, so it is higher up the order of operations. This is done by right clicking on the filter and selecting 'Add to Context'.

Now after this, we are able to show the Top 10 from a whole league within Tableau, as the filter is being applied BEFORE the Top 10.

Hopefully this breaks down what context filters are, and why they are so important in Tableau.

Author:
Rory Moxom
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab