# 10. Creating Constant and Computed Sets

Overview

Sets are more powerful than groups, that can be created through manual selection or computed using calculations. Find out how to create both types of sets in this lesson.

To explore more Kubicle data literacy subjects, please refer to our full library.

Summary

Sets in Tableau

- Unlike groups, set elements can either be selected or computed
- Computed sets update automatically when new data is added to the Tableau workbook
- Elements can also belong to multiple sets without a problem and sets can also be combined

Creating a set through selection

- Select the elements from the view that you want to include in the set
- Click on the intersecting circles icon and name your set

Creating a set through computation

- In the Data pane, click on the dropdown next to the dimension of interest
- Select Create and then Set
- Go to the Condition tab and create your criteria here

Transcript

In Tableau, sets are custom fields that define a subset of data based on some conditions. A set can be based on a computed condition, for example, sales over a certain threshold, or they can be set manually with selection. Unlike groups, computed sets can update as your data changes. And we'll see this later in the lesson.

Let's start by looking at this current scatter plot where each dot represents a company. And on the Y axis, I have annual revenue from that company and on the X axis, I have the payment date.

And what I'd like to do, is to create a set of all the highest paying customers. And to do so I can simply drag across the top of my sheet.

When I do this, I can hit the dropdown and create a set.

Which I'm going to call, big customers.

In the set I have 128 members and it can be company name or we can have the payment date or both columns in the set. I'll keep just the company name in the set.

Next I have the option of exclude.

Exclude is really useful if we want to capture the inverse of the list. So if I hit Exclude it will select the remaining dots that are not currently selected in my view. However, I have the companies that I want so I'll now press Okay. And as you can see, the set appears on the left-hand side in the data menu.

When selecting sets manually like this we may not be as accurate as when we can compute sets.

So let's try a computed set and compare it to the set we've just created.

So let's go to the dimension of company name, hit the dropdown and create a set.

And the set will be called, big customers two.

And instead of selecting these manually I'll create a condition.

And the condition will be, the revenue is greater than say 38,000.

And then I press Okay.

Obviously in this particular dialog box there are many different ways of setting conditions using formulas, mean, max, et cetera.

When I press Okay, I have a new set now created in the data menu.

To compare these sets, we have a couple of options but the easiest is actually to combine them.

So I'll select my first set Ctrl and select the second, hit the dropdown, and create combined set.

And when I create a combined set I have a couple of options.

I can include all the members of both sets just the shared members, or the customer two except shared members, and all the customers except shared members. Let's select all big customers two except shared members.

And then I press Okay.

Now let's drag this shared set onto our chart. And drag it onto color.

If I now select In, I can isolate all of the data points in this combined set. Which remember, is only the values that were included in big customers two and not in big customers. So my computed set has one, two, three, four, five, six, nine individual customers that were not included when I did my manual selection. Once I have created my set I can now use it to perform other analysis. So let's say, I want to see where my biggest customers are based.

I'll take the set, let's say big customers two, I'll put it in columns, and I'll take state.

And I'll exclude out because they only want to see the values that are in my particular set.

And now I'll map these give me a better sense of where my customers are based. And as you can see, we tend to have large customers in most states in the U.S. apart from some states in the Midwest and in the Southwest.

Using sets in this way can give you a very intuitive sense of how different segments within your data set are located or how they are performing. What's more computed sets such as big customers two, always update with new data. And in many ways are much superior to the manual sets that I showed you at the beginning of this lesson. In contrast to groups, sets are much more flexible because they can be combined and elements can belong to multiple sets unlike groups or elements can only belong to one group.

If you want to use some of the functionality around combining certain elements I would always default to sets more than groups unless you have a very simple application where groups might be of benefit.

Tableau Essentials
Filter, Groups, and Sets

Contents

05:34

03:19

03:58

07:52

03:10

06:07

04:56

04:08

05:40

06:17

#### Exercise 3

My Notes

You can take notes as you view lessons.

Sign in or start a free trial to avail of this feature.