Tableau Deep Dive: Sets – Introduction to Sets

Data

Tableau Deep Dive: Sets – Introduction to Sets

Tableau Deep Dives are a loose collection of mini-series designed to give you an in-depth look into various features of Tableau Software.

The idea behind a Deep Dive article series is to spend far more time and energy on mastering a topic than what would be possible inside a traditional learning environment. We’re going to dig really deep into sets over multiple articles with real world use cases and examples.

Here’s our article schedule:

  • Part 1: Introduction to Sets
  • Part 2: Constant Sets
  • Part 3: Computed Sets
  • Part 4: Membership (In/Out)
  • Part 5: Combined Sets
  • Part 6: Calculated Fields
  • Part 7: Hierarchies

We’ll start our deep dive with a quick overview of sets.

What are Sets?

Sets are custom fields that are created within Tableau Desktop based on dimensions from your data source. They are subsets of your data, which can be created manually (see article #2) or computed (see article #3). Either dimensions or measures can be used to determine what is included or excluded from a set using conditional logic.

There are numerous use cases for sets (courtesy of my InterWorks colleague Katie Fontenot). Some of these use cases include highlighting data that meets certain criteria, examining manually selected members of a dimension, comparing and contrasting members in the set vs. those that are not (IN/OUT), creating combined sets and much more. For instance, I could create a set of geographies that have been deemed strategically important to my business or another set that focuses on the least profitable products.

Within Tableau, the icon for sets is represented by a small Venn diagram (two interlocking rings):

https://onlinehelp.tableau.com/current/pro/online/mac/en-us/Img/symbol_group_schema.png

Like parameters, sets also get their own section in the Data pane:

Tableau Sets in Data pane

As well as being saved inside of your workbook, sets are also included in Tableau data sources (*.tds files), Tableau data extracts (*.tde files) and packaged Tableau data sources (*.tdsx). Now that we have a fundamental understanding, let’s compare and contrast sets to two similar features in Tableau Desktop – groups and filters.

Sets vs. Groups

At first glance, sets and groups might seem very similar. For instance, let’s say that I want to analyze five different countries where I want to start selling my products. When I click on all the prospective countries, I get the option from Tableau to create either a set or a group:

Sets vs. Groups in Tableau

In the scenario above, creating a group or set would produce a similar outcome – a new field in the data window that contains my countries of interest.  Even more so, bringing that new field (whether a set or a grouped field) would produce very similar visual results, as well.

There are key differences though between sets and groups.

Groups are used to simplify a visualization that is using a dimension with a large membership. Adding groups creates a new field that can be used to categorize values in that dimension or even create another level in a hierarchy. Groups must be created within a dimension.

Sets are subsets of your data that are also based on existing dimensions. Sets get their own special area in the data pane. You can create a set visually by selecting marks or you can create a computed set by using logic that creates conditions on how the IN/OUT membership of the set will be calculated.

For example, I created a grouped field that has North American countries grouped, South American countries grouped and then all other countries left separate (or ungrouped):

Grouped and ungrouped fields in Tableau

I could not replicate this example above with a set. When you create a group, you’re manually organizing members of a dimension, typically rolling them up to a higher level. The group created above is simply a collection of members within a dimension. Groups are static. New groups are not created if the underlying data changes. Instead, any new members will either appear ungrouped or inside of the Other group.

Remember, sets focus on members of the set that are IN as opposed to members that are OUT. As we’ll see in article #4 of this Deep Dive, sets also allow us to focus solely on the IN membership. This option changes the nature of how we can use sets.

Sets really shine when we apply conditional logic to dynamically update the members in the set.

Rather than manually selecting these countries, I could create a combination of sets that 1) includes only countries where products aren’t yet sold (i.e. new markets) and 2) has a minimum population threshold (i.e. opportunity). Since they are based from conditional logic, the members of that set would dynamically update as the underlying data changes. For instance, if I were to open business in China, it would be removed from my set of high-potential, new markets. These are logical conditions that my set is considering as it determines what is included or excluded each time it is used in my visualization.

Sets vs. Filters

Filters reduce the data that is visible either in our view or in our workbook depending on where your filters are applied. Filters can even use with logical conditions on measures or dimensions to modify the subset of data that is returned. This seems much more in line with the functionality of a set than what we saw from a group.

So, how are they different? The biggest difference is that sets can be saved. They create a new field, one that appears in the sets area of your data pane. As a result, your sets can be used in other areas, such as in calculated fields, as a component of another set and more.

Another key difference is where sets occur in Tableau’s order of operations, also known as the query pipeline. Sets are computed before dimension filters and measure filters. How does this effect your viz? Let’s take a deeper look.

As a use case, let’s look at the Sample – Superstore data source that comes ready to use with Tableau Desktop. I want to show my SUM of Sales for all states that border the Pacific Ocean (California, Oregon and Washington). I’ll use State as a filter control, which changes my bar chart to only show those states. The problem comes with my filter control. It will still show all states in the State dimension, which isn’t what I want. I want my user to be able to select only from those three Pacific states.

State filter

This is not ideal. I want to exclude those extra states from showing up in my filter control completely. I can use a set to accomplish this feat. Within my set, I will only choose states border the Pacific Ocean. I’ll name my new set “Pacific States” and then apply it as a filter to get the following result:

Applying sets as a filter in Tableau

Now look at how my filter control for States is modified. My set is considered before my dimension filter as per Tableau’s order of operations, which is why only Pacific States are showing up in the filter control.

We’ll go through the steps on how to build this example as we progress through our Deep Dive on sets (see part 2).

What’s Next?

In the next few articles in this series, we’ll examine how to build constant sets (also known as manual sets) and computed sets. Leave any comments, questions or additional thoughts in the section provided below.

Cheers!

Want More Tableau Deep Dives

  1. Tableau Deep Dive: LOD – Introduction to Detail
  2. Tableau Deep Dive: LOD – The Include Calculation
  3. Tableau Deep Dive: LOD – The Exclude Calculation
  4. Tableau Deep Dive: LOD – The Fixed Calculation
  5. Tableau Deep Dive: LOD – LOD Calculations vs. Table Calculations
  6. Tableau Deep Dive: Parameters – Parameter Overview
  7. Tableau Deep Dive: Parameters – Parameter Properties
  8. Tableau Deep Dive: Parameters – Filtering – Top N
  9. Tableau Deep Dive: Parameters – Calculated Fields
  10. Tableau Deep Dive: Parameters – Filtering Across Data Sources
  11. Tableau Deep Dive: Parameters – Bins
  12. Tableau Deep Dive: Parameters – Reference Lines
  13. Tableau Deep Dive: Parameters – Table Calculations
  14. Tableau Deep Dive: Sets – Introduction to Sets
  15. Tableau Deep Dive: Sets – Constant Sets
  16. Tableau Deep Dive: Sets – Computed Sets
  17. Tableau Deep Dive: Sets – IN/OUT
  18. Tableau Deep Dive: Sets – Combined Sets
  19. Tableau Deep Dive: Sets – Calculated Fields
  20. Tableau Deep Dive: Sets – Hierarchies
  21. Tableau Deep Dive: Dates – Introduction to Dates
  22. Tableau Deep Dive: Dates – Preparing Dates
  23. Tableau Deep Dive: Dates – More Date Functions
  24. Tableau Deep Dive: Dates – Exact Dates
  25. Tableau Deep Dive: Dates – Custom Dates
  26. Tableau Deep Dive: Dates – Rolling Dates
  27. Tableau Deep Dive: Dates – Calendar Filters
  28. Tableau Deep Dive: Dates – Week-by-Week Comparison
  29. Tableau Deep Dive: Dashboard Design – Planning
  30. Tableau Deep Dive: Dashboard Design – Layout & Structure
  31. Tableau Deep Dive: Dashboard Design – Proof of Concept
  32. Tableau Deep Dive: Dashboard Design – Adding Interactivity
  33. Tableau Deep Dive: Dashboard Design – Visual Best Practices
  34. Tableau Deep Dive: Dashboard Design – Optimization & Governance
  35. Tableau Deep Dive: Dashboard Design – Publishing
  36. Tableau Deep Dive: Table Calculations – Custom Sorts, Part One
  37. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Two
  38. Tableau Deep Dive: Table Calculations – Custom Sorts, Part Three

More About the Author

Robert Curtis

Managing Director, APAC
Building Solutions with InterWorks at Corinium’s Data Architecture Conference in Melbourne InterWorks was a proud sponsor of the Data Architecture Conference hosted by Corinium in Melbourne on 21 and 22 June 2023. Hundreds of ...
Virtual Event Recap: Deep Dive of Tableau Parameters For our June Lunch and Learn, we did a deep dive on parameters for our friends across Australia and Singapore. Tableau is the premier ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!