More performant views in Tableau with Context Filters

How to have more performant views in Tableau with Context Filters

Imagine that you are participating in an online Tableau course, in a form of a weekly skill pill video specially created for you. Its purpose is to make data analytics easier to understand and to explain more of the way Tableau software functions.

Tableau analytics can be challenging but, as long as you work daily with charts and you have a team of consultants to help you better understand your data, you are on your way to creating astonishing Tableau vizzes.

When you must deal with a very large amount of data, context filters are the best solution for you to sort all kinds of products. You can create top 10 filters, based on the needed context and categories. What is important to know is that all filters are computed independently. This means that a filter has access to all your data without concerning other filters.

Even if at the beginning looks like context filters are hard to understand, they basically are used to filter all the information transferred to each worksheet. Their biggest advantages are:

→ Independence

→ Rapidity in giving the results

→ Capacity of granularity

→ Reveals only relevant results

→ Time friendly

→ Improved performance

→ Find data easier

→ Avoid extra work

Do you want to see context filters in action? You may create a context filter to improve performance or to create a dependent numerical or top N Filter. To create a context filter, please follow these steps:

Step 1: Connect to data

→ In Tableau Desktop, connect to Sample – Superstore sample data provided by Tableau

Step 2: Create a visualization that shows the sales for all sub-categories, sorted with the highest sale at the top.

→ From the Data pane, drag Sales measure to the Columns shelf.

→ Drag Sub-Category to the Rows shelf and sort it with the highest sales at the top.

Step 3: Create a Top 10 filter to just show the top-selling products.

→ Drag the Sub-category field to the Filters shelf.

→ In the Filter dialog box, switch to the Top tab and define a filter that is Top 10 by Sum of Sales.

→ When finished, click OK. The view is filtered to show the top 10 product sub-categories in terms of sales.

→ Add another filter to show only Furniture products. Drag the Category to Filters shelf and select only Furniture.

→ When finished, click OK. The view is filtered by instead of 10 products, it now shows only 3 because by default all filters are evaluated separately and the view shows the intersection of the results. So, this view shows that three of the top 10 overall products are furniture products.

→ To find out what the top 10 furniture products are, we need to make the Category filter a context filter.

→ Right-click the field on the Filters and select Add to Context.

→ The view is updated and now it shows the top 4 furniture products because only four of the sub-categories contain furniture, but it is well known that the Top 10 filter is being evaluated on the results of that context.

If you need to visually see how it’s done, here is the video created by Andreea Chiriac, Data Analyst at btProvider.