By default, all filters that you set in Tableau are computed independently. That is, each filter accesses all rows in your data source without regard to other filters. However, you can set one or more categorical filters as context filters for the view. You can think of a context filter as being an independent filter. Any other filters that you set are defined as dependent filters because they process only the data that passes through the context filter.
You may create a context filter to:
Improve performance – If you set a lot of filters or
have a large data source, the queries can be slow. You can set one
or more context filters to improve performance.
Create a dependent numerical or top N filter – You can set
a context filter to include only the data of interest, and then
set a numerical or a top N filter.
Context filters are particularly useful for relational data sources because a temporary table is created. This table is automatically generated by Tableau when you set the context, and acts as a separate (smaller) data source that results in increased performance when you build data views.
For SQL Server, MySQL, and Oracle data sources, you must have permission to create a temporary table on the server.
For multidimensional data sources, temporary tables are not created and context filters only define which filters are independent and dependent.
- Creating Context Filters
- Example – Context Filters