See all tips |
View as pdf
Using Context Filters to Improve Performance
| If you are applying filters to a large data source, you can improve performance by setting up context filters. A context filter is a filter that is applied to the data source first, then all other filters are only applied to the resulting records. That way, you don't have to apply each filter to every record in the data source. | |||||
Here's how it works.The view below is of an MS SQL Server database containing airline information for every flight in the United States. As you can imagine, this is a very large data set. The view shows the average delays by destination and carrier. In this example, we are only interested in flights originating from Seattle in September, October, and November. You can see the Origin City and Flight Date fields are on the filters shelf. |
|||||
|
|||||
| As it is, Tableau has to look through every record in the database twice to apply these filters. To speed up the process, let's add the Origin City filter to the context. | |||||
To create bins:Right-click the Origin City field on the filter shelf and select Add to Context. |
|||||
|
|||||
| You can see that the filter changes color and is marked with the context filter icon. | |||||
|
|||||
| Now the Flight Date filter is applied only to the records that originated from Seattle. Any additional filters you add will also only be applied to the records that pass the context filter. | |||||
| If you have multiple filters you want to add to the context, make sure you add them all at once. | |||||
To add multiple filters to the context:1. Hold down the CTRL key on your keyboard and select the filters you want to add to the context. |
|||||
| 2. Right-click one of the selected fields on the filter shelf and select Add to Context. | |||||
| Note: You can also improve performance using Tableau Data Extracts. To learn more about Extracts click here. | |||||
|
|||||


