About this Blog
Tableau is majorly a visualization software that query the data source ang gives result based on the actions taken by the user. These actions are performed in Tableau in a certain predefined order. One such action is filtering the data. A defined order of actions (also known as operations) are applied to these filters. In this blog I will be first discussing about various filters in available Tableau followed by the significance of order of operations.
Various Filters in Tableau
There are six major types of filters that can be applied to your data source directly or while while you are building your view on worksheet. These filters are as follows:
- Extract Filters
- Data Source Filters
- Context Filters
- Dimension Filters
- Measure Filters
- Table Calculation filters
Extract Filters
When you connect to any data source, you can either have a live connection with that data or can extract the data. In live connection, whenever the data is updated, it instantly amends the worksheets based on updated data. Whereas, in extract connection, Tableau extract all the data from the data source and store it in a temporary location. Then the extracted data and charts can only be updated by the users. User can either manually update the extracted data or can set an periodical updates. So when you choose to extract data, you can also filter the data at this point. This is called extract filter. This filter will apply directly to the data set and will only fetch the relevant data to tableau. This reduces the amount of query Tableau has to perform to the data source which results in smoother tableau experience.
To add extract filter, there is an edit button right next tot the extract radio button in the data source window as shown below.
Upon clicking the edit button, you can add various filters as per your requirements.
Data Source Filters
In case of Data source filter, without filtering, all the data from the data source is fetched first, and then filters the data based on the data source filters which are made available to be used in the worksheet. A data source filter can be added by clicking the ‘Add’ button next to the extract button as shown above.
Context Filters
Context filters are used when there are multiple filters applied to a worksheet and the end user wants any specific filter to precedent the other filters. In other words, if any filter is added to the context, this filter will act first followed by the other filters (except Extract and data source filters). For more information on how context filters work, read my blog ‘Importance of Context Filters in Tableau‘ where I have discussed in details about context filters.
Dimension and Measure Filters
As the name suggest, these are the filters that comes into action if any dimension fields or any measure fields are used as filters. Dimensional fields are the fields that contains categorical or qualitative information whereas measure fields are fields that contain quantitative data.
Out of many different ways, easiest way to use a dimension or measure field as filter is to drag and drop the dimension and/or measure field to the filter shelf.
Table Calculation Filters
Table calculations can be applied by right clicking the value fields and selecting the quick table calculation or add table calculation option. They are at the lowest in the hierarchy in order of operations.
Order of Operation
In previous section, we discussed about six major types of filters. As mentioned above, these Tableau filters are applied based on certain order of operation. A flow diagram at tableau website describes the order of operation.
What this means in that filters that at higher in hierarchy will perform action first and filter the data. With this, only filtered data is available for the filters that are ranked lower in the hierarchical table. For example, if data source filter and dimension filters are applied, then first data will pass through the data source filter and then the dimension filter will act on the remaining data.
Additionally, apart form these primary filters, there are some secondary filter. These filters when brought into filter shelf, will act based on the above order of operation. For example, Sets, conditional filters, top N and Fixed LOD will always apply before Dimension, measure or Tableau Calculation filters.
Conclusion
In this blog we discussed about various types of filters in Tableau. We also discussed how order of operations play role in filtering the data. Thank you for ready my blog. i hope you were able to learn something today.