What is Context Filter in Tableau ?
In Tableau, a context filter is a type of filter that allows you to create a temporary table of data based on a specific dimension, which can improve the performance of your workbook. Context filters are useful when working with large datasets, as they can reduce the amount of data that needs to be loaded into memory.
In another words, In Tableau by default, all filters in Tableau are work independently. Meaning each filter accesses all rows in the dataset without regard to other filters and a Context filter is an independent filter that can create a separate dataset out of the original dataset and work based on selections in the worksheet of Tableau. One or more categorical filter that separates the dataset into major parts can be used as a context filter.
Note: This context filter are helpful if you are calculating 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.
Key features of context filters in Tableau:
- This create a temporary table of data based on the filtered dimension.
- It can be used to speed up queries and improve performance.
- It can be used to apply filters in a specific order, which can affect the results of the visualization.
- It can be used to filter data across multiple data source
- It is useful when working with large data sets or complex calculations.
Overall, context filters are a powerful tool for working with large and complex data sets in Tableau. They can help to speed up queries, improve performance, and create more accurate reports and visualizations.
By using context filters, you can create more sophisticated visualizations like Donut Chart, TreeMap chart etc.. that provide meaningful insights into your data.
Steps to apply filter:
1. Create any table and Graph in Tableau and drag any field which you want to put as context filter. In below image we have drag “Item Type” as Context filter
2. Now right click on the “Item Type” dimension in filter panel and click on “Add to Context” option
3. The “Item Type” dimension colour will get change from Blue to Grey, it means Context filter in tableau is already applied.
3 different examples of context filters in Tableau:
Example1: Top N Filter
lets take example of product dataset with for multiple products, and you want to analyze the top 10 products by sales. By applying a context filter to the “Product” dimension, you can create a temporary table that only includes data for the top 10 products.
This Context filter in Tableau can improve the performance of your workbook and make it easier to work with the data.
Example2: Date Range Filter
Lets take another example of sales dataset with for the last five years, and you want to analyze data for the last year.
By applying a context filter to the “Date” dimension, you can create a temporary table that only includes data for the last year. it This will improve the performance of whole dashboard and visualization in Tableau
Example3: Geographic Region Filter
With example of again sales dataset for multiple regions. You can apply a context filter to the “Region” dimension, you can create a temporary table that only includes data for the region of interest.
You can use this context filter on Region field to improve the performance of dashboard in tableau
Conclusion:
Context filter in tableau can be used to create temporary tables of data that can improve the performance of your workbook. By using context filters, you can reduce the amount of data that needs to be loaded into memory, which can make it faster and easier to work with large datasets.