How to use Sets in Tableau

Today we’ll be learning how to use Set in Tableau. I’ll be using Superstore data for the
tutorial.

1. How to remove unwanted values from filter

While working with filters sometimes we want to remove the unwanted values from filters. We can do that using sets.

First create a basic chart as shown in the image below. Put Discount in the Columns shelf and State in the Rows shelf. We put Subcategory in the filters and suppose We don’t want these subcategory values (Accessories, Appliances, Art, Binders and Bookcases) to appear in the filter. For that we’ll create a set.

 

1-compressed
Now to create a set click on the ‘Sub- Category’ drop down and click on Create> Set.

2-compressed
Create set window will appear. Now first name your set and then Select all the values except those values which we don’t want to appear on the filter as shown in the image below and click OK.

3-compressed

 

We can find the set we just created in the Sets section.

4-compressed
Put this we just created to the filters section and that’s it.

5-compressed

We can see others values are not showing in the filters.

2. Use of Condition

Suppose we have so many values in the filter to show. The previous method will be hard and time consuming. So we can use Condition option in the set.

First create a basic chart as shown in the image below. Put Discount in the Columns shelf and State in the Rows shelf and put Order Date in the Filters card. As we can see we have Date values from 2011 to 2014.

1-compressed

We want to Show date values in the filter from 2013. For this we’ll create a set with the condition.
go to Order Date > Create > Set and then Create set window will appear. Name the set and then in the condition option Create a condition shown below.

[Order Date] >= #01-01-2013#
 we have to put dates between #'s while comparing.

2-compressed
Now put your set in the filters card and that is done as we can see in the below image.

3-compressed

Now the dates in the filters are from 2013.

3. Top N or Bottom N values

We can also use set to Show Top N or Bottom N values ( there are other methods too for the same)

First create a basic chart as shown in the image below. Put Discount in the Columns shelf and State in the Rows shelf.

Suppose we want to see Top/Bottom 15 States by Discount. Then Go to State > Create > Set and select Top option as shown in the image below and choose ‘By field’ option then select Top/Bottom 15 by Discount and Average and click OK.

For Top 15

1-compressed

For Bottom 15

1a-compressed

Now put this set to filters card and we get the desired result.

 

4. Combined Sets

Using combined sets we can join sets to make a master set which contain values from both the sets. To create combined set, select the sets and right click then click Create Combined Set. Check the given options in the window shown below.

3-min 4-min

 

This tutorial will give you basic idea about Sets in the Tableau. Keep visiting Analytics Tuts for more tutorials.

 

 

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *