The Tableau Performance Checklist series is designed to help you streamline your dashboard performance and Tableau Server configuration. Each post expands upon one item listed in the master Tableau Performance Checklist.
The next item in our Filtering checklist is:
“Avoid quick filters or actions that drive context filters. These require reloading the context table and should be avoided wherever possible.”
There’s a lot to digest there, so let’s get started.
What Is a Context Filter?
The filters that you add to your visualization are each independently calculated, regardless of what the other filters are doing. You can add “context” to your filters by adding a context filter. Once you create a context filter, then all other filters are calculated using this new data set.
Context filters are identified by their grey color on the Filter shelf.
Let’s take a hypothetical example of an insurance company with 50 million customers. That’s a massive number to use as a filter, but if we added a context filter for only 40-year old males, then Tableau will create a new context TEMP table with only those values.
All of the filters will access this new table to draw their values from the limited set of data. The goal of this context table is to make it as small as possible. If done correctly, it will improve performance.
There’s the catch: “IF done correctly.” If the context filter selects everything or doesn’t sufficiently trim down the underlying data to a more manageable set in the new context table, it can create big performance problems.
Let’s take the example above with our insurance company and our customer data source of 50 million rows. Each time the visualization is loaded, Tableau will faithfully recreate this context table. If the context table is not only large but also wide, you can already see the massive performance load holding back the visualization.
The problems compound if you consider a Tableau Server with multiple users, each creating brand new 50 million-row context tables with numerous columns.
Optimizing Context Filters
We do not recommend using quick filters to drive context filters whenever possible. The reason for this is that for each quick filter, Tableau will query the appropriate data source to return the values for the quick filter. If the visualization uses a large context table, then it’s the double whammy of performance lag.
The first thing to consider when using a context filter is how to make the newly created TEMP table as small as possible. This might mean filtering rows based on a value as well as eliminating columns that are not needed for that particular visualization. Your goal should be to reduce the size of the data set down to one tenth of the original size at the minimum.
Mastering Best Practices
If you’re interested in becoming a Tableau Server guru, then learning these performance best practices is essential. Check back frequently as we add new posts and dive deeper into each point in the Tableau Performance Checklist
Another great way to identify best practices is to leverage the insights offered by our Performance Analyzer, part of Workbook Tools for Tableau. It will examine all of your workbooks, worksheets, dashboards and data sources against a list of best practices to ensure that you’re using all the tips and tricks to guarantee your visualizations are moving at light speed.
As always, feel free to get in touch with us if you have any questions regarding performance or anything Tableau related! We’d be happy to help.