Tableau Deep Dive: Sets – Constant Sets

Data

Tableau Deep Dive: Sets – Constant 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.

Constant sets are sets that once created do not change. If the underlying data changes, the membership of the constant set does not change to reflect these differences. These are also known as manually created sets. In this part of our Deep Dive on sets, we will examine how to create constant sets using a couple different methods. Finally, at the end of this article, we will see how disaggregation affects set creation.

Method #1: Click and Create

On any view, you can select marks or headers to create a set. First, I’ll start with a basic bar chat, such as our country by population from part one of this series. I’m just going to click on whichever countries I want to include in my set. When I do, I get the option to create a set in my tooltip:

Tableau > Create Set

Alternately, I can right-click on any of the selected marks and choose Create Set from the context menu. Either way brings up the following Create Sets window:

Tableau > Create Sets Window

Currently, these members of the Country dimension are considered IN the set while all other countries are OUT of the set. If I click on the radio box Exclude, then it will reverse this relationship, where these five countries are now OUT and everything else is IN. I can remove any of these members by moving my cursor over the country and clicking on the red X that appears next to it:

Remove members

Finally, I can click on the Add to Filters shelf to have my newly created set automatically applied to my view as a filter.

Method #2: General Tab

Another way to create a constant set is to right-click on a dimension in the data pane and select Create > Set.

Tableau > Create > Set

That brings up a different Create Set window. This window gives you the ability to create your set using a variety of different methods, including manual selection, conditional logic and top/bottom N. This is also the method that we’ll use to create Computed Sets in part three of this Deep Dive. You might notice how similar the Create Sets window looks in comparison to the Create Filter window. Indeed, a lot of the functionality here is the same:

Create Set window

For a constant set, we’ll only use the General tab.

Let’s imagine a potential use case. I want to create a set for any product from a particular manufacturer. For this hypothetical example, I’m going to choose Eldon products from the Sample – Superstore Sales data source. I’ll use the Select from List option, click the None button to deselect all results and then type in “Eldon” in the search box.

This brings up a search result of all products that have “eldon” in their alias:

Search results

Remember, it is searching for “eldon” in any context and not necessarily at the start of the product name. If you happen to have a product that has “eldon” inside of its title, such “Sheldon Pencil Holders”, those products will also be included in this search result. A quick scroll through the search results confirms that I’m only selecting members for my set that are appropriate.

I’ll press the All button and create a set of Eldon products:

All selected

Note how my Summary area has changed as well. I’m now including 49 values in my set of a potential 1,850 products. It’s important to remember that creating a set this way is not dynamic. Future products for this manufacturer (i.e. those that include “eldon”) will have to be added manually.

Disaggregation and Sets

You may have discovered that there are instances in which you are not given the option to create a set. Let’s examine this scenario using a scatterplot. Let’s build the following view: Profit on Rows and Sales on Columns with Aggregate Measures turned off in the Analysis menu. I’ll add Segment to Color and Market to Shape. Here’s the view I get:

Tableau view #1

When I drag and select a group of marks in this view, I do not get the option to create a set:

Can't create a set

I only get the option to create a group. The other options, such as Keep Only and Exclude, are also missing.

Why?

Remember in part one of our Deep Dive on sets, we stated that sets are fields that we create based on existing dimensions. In the scatterplot above, profit and sales are completely disaggregated. Without a dimension in our level of detail, we cannot create a set. Having dimensions on the Color shelf or Shape shelf does not satisfy this requirement.

To fix this problem, let’s first turn Aggregate Measures back on in the Analysis menu and then drag a dimension onto the Detail shelf. I know that I can replicate my original scatterplot by using the Row ID dimension in Global Superstore training. The Row ID field is a record-level key, which offers me the same granularity as disaggregation.

As that is a dimension, however granular, I now get the option of creating a set when I select my marks:

Creating a set after selecting marks

Each member of the set from the above scatter plot has three attributes – from the Detail shelf (Row ID), the Color shelf (Segment) and the Shape shelf (Market). My Create Set window looks like this as a result:

New Create Set window

I can choose to change the character that separates the members of my set. Currently, it is a comma. This will change how the members of the set appear if they are used as headers. Finally, I can also remove which dimensions are considered in my set:

Remove dimensions in set

Just like removing individual members, I can mouse over the dimension header and click the red X to remove it from the set.

Order of Operations Revisited

In the introduction of the Deep Dive on Sets (part one), I explained how sets are considered earlier in Tableau’s order of operations. I used this knowledge to remove dimension members form my filter control. Let’s now build that example together.

Remember, I want to only show states that are bordering the Pacific Ocean. If I show my filter control for my user, then all of the states are going to appear as filter options:

All states appear

In other words, my report user can simply turn them back on. We’ll use a set to remove the undesired states completely from my view without having to use a data source filter. To create my set, I’ll select my three states and select Create Set:

Select states and select Create Set

I’ll give my new set a name:

Rename set

I can then add my set, Pacific Regions, to the Filter card. Remember, Tableau considers sets before dimension filters in its order of operations. This means that only the members of my set will be available in the filter control.

Updated filter control

Shama-lama-ding-dong.

What’s Next?

We’ve just covered manually created sets, or constant sets. In part three of this Deep Dive, we’ll examine computed sets. Until then, Tableau fans, leave your questions, comments or thoughts in the space 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!