This blog topic was born out of a training course I delivered which always brings new questions and observations. No matter how often I do them, I’m always learning something myself. It concerns the ability to expose sets once they been created to allow end users to control the values in the set.
I noticed there are two ways that we can create a set and that these two methods produce different options when showing the set on a dashboard or sheet.
Enumerated Sets
Firstly, we can create the set from dimensions in a view, by selecting values from the canvas we create a manual or “enumerated” set:
We can use this set in a number of ways — on rows or columns, as a label or colour, or as a filter. As you may already be aware, we can use sets by showing IN and OUT values or we can show the members within the set. When we use it as a filter, we are then able to select that filter and show it on the sheet:
In the screenshot above, I have chosen to show the members in the set and show the filter. This exposes the values in our set and allows us to use this list to select values which we want to exclude and include from our view. The important thing to note here is that only the values in the set are shown in the filter.
Computed Sets
The alternative way to create a set is from the data pane. This could be a static set or something more dynamic using a conditional statement or showing the top or bottom values based on a selected measure. Tableau calls this a “computed set” and, again, we can add this set to the filter shelf:
From the filter shelf, we can right click and now have the option to “Show Set.” This gives the ability to add and remove values from the set on the fly! This allows our end users to control set values when consuming a dashboard. Much more flexible! When we create a conditional set based on a top or bottom n (eg. top 10 items sold), we can also add the set to the filter shelf and show the set on the view (the same process as shown above). This allows us to exclude values from the view and remove them from our top 10 list. So, is this a “top 9 list,” then? Well, no — any item that we remove from the set will no longer be considered in the top 10 calculation, so the 11th ranking value will add into our list so we see a total of 10 values.
So, How Can I Find Out if I Have a Computed Set or an Enumerated Set?
Once you’ve created a set, you can check which type of set you have created by right clicking the set within the data pane and choosing “Describe…”
The subsequent dialog box shows the set type. This cannot be altered after the set is created:
Why Does This Matter? How Can I Use This in my Work?
If we want to compare benchmark groups from our data with non-benchmark values, sets can be a great option. Sets allow us to see both benchmarks values and non-benchmark values in the view at one time, but with our computed set, we can decide which values to add into our benchmark as we go. Take a look at the dashboard below to see this in action: