Recently Tableau has published a white paper on LOD or level of details computation. In the paper, there is a chart on the precedence of filters which is very nice.
Especially this shows by what precedence various filters work in succession. It is essential for any Viz developer to understand this precedence and use them accordingly.

I found that the chart above ignored sets, which are also a class of filters by its own.

Sets as Filter
Sets are a special class of filters which narrow the scope of the data set. When you create a set and put it on the filter shelf, all the following calculations will take place in the context of the set. The filter conditions for the set can be configured in this interface:
The definition of the filter can be based on dimension or measure or both. Only the data that meet the conditions will be included in the set.

For a dimension, right click it, we can see a filter settings like this
Note that the wildcard option can also create a set. But this is not included in the Create Set menu!

So, there are 4 ways to create a set filter or these 4 filters are all set filters:
- General: handpick a list
- Wildcard
- Conditional
- Top

These conditions can be all used in parallel to define a set!

Revised Precedence of Filtering
Here is the one I draw as the revised precedence of filtering.
All filters except the last one reduce the number of rows/records or narrow the scope of the original data set. 

The last one - Table Calc Filters - will only select the part of the calculation results that are of interest to the viewer, and hide the rest of the results. They will by no means remove a single bit of data.

Context filters are preceding set filters and all the rest. Set filters further narrow the scope of data to those within the set. They act like context filter to the following dimension filters. 

We have built an example to illustrate how set filters work with dimension filters and LOD.

Sets vs Dimension Filter
In the example, a set is created for top 10 customers in terms of total sales. The category filter can have multiple options. All the category options will be calculated within the top 10 customers. The set provides the context for the category filter here.

Sets vs LOD
LOD will work independent of sets. So sets have no effect on LOD calculations. The following example shows that with the set in filter shelf, we can still use LOD to calculate the minimum sales per customer per category over the entire customer base.
The examples are included in a workbook which can be downloaded.

In conclusion, we showed here where sets work in the precedence of filtering. They are after context filters and LOD, and before dimension filters.





0

Add a comment

Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.