Introduction to Creating Set in Tableau
Well, a set is a group bunch of points mapped together which can be either static or dynamic. Creating a Set in Tableau can be considered as an alternative option for filters and groups. So, the traits of a set can be any of the following:
- The output may be that the point is inside the set or not, in general terms true/false.
- Whether the point is inside the set or outside – in/out.
- We can search by using conditions like searching the age > 45 to a person’s age or even can take the top 5 or top 10 of any group.
- We can also combine two sets to make a single set by using joins.
An example of creating a Set in Tableau as a filter
In this example for the Creating set in a tableau, we are going to consider the superstore sales data which is available on the tableau’s website
We will be getting the excel file into tableau using import using excel.
Now we have taken the measure (Profit) in columns and the dimension (customer name) in rows and have got the following result.
Now for creating a Set in a tableau, we have to do the following:
Right-click on customer name and then click on a Create a Set.
(Note: Sets are often anchored to dimensions)
After selecting the create set option a dialogue box will open up. Three tabs the last one being Top, the easiest one among all and we rename the set as a Top customer.
Now we will select the option a By field and select profit and sum and enter 30 as input.
So now we can see that a new partition is created along with measures and dimensions a new tab appears as Sets.
Now if we drop the set in the filters pane we get the list of the top 30 customers in the data.
4.5 (2,948 ratings)
An example of creating a Set in a tableau as IN/OUT field
Now remove take a new sheet and place the measured profit in the column field and now place the set named top customer in the rows field then we will have the below image.
Now a question may arise that what if we want to see the top 30 and bottom 30 together with the same sheet and not on two different sheets.
An example of creating a Set in tableau (showing both the top 30 and bottom 30)
For this scenario, we select the bottom and also, we are adding a color variance just to have a good look between the top 30 and bottom 30 customers.
Now we have to click on a set and select a combined set.
A dialogue box will pop up, we will be renaming the name as “Top 30 and bottom 30 customers”.
We are given four options to select and if you are comfortable with databases then these options are similar to those of the four joins which are used in the database, namely:
- Full join
- Inner join
- Left join
- Right join
One of the best use case scenario of sets being to be able to be used as tools to clean up your data. Here we are considering the dimension (state) and are looking for the number of units that are sold in the state.
Sometimes we would like to remove some data from the dataset (which can also be called as subsetting the data ) and for that, we here right-click on state à delete exclude à and then again select the states which need to be removed
Here we are excluding the states Florida and Georgia.
After creating a set in Tableau named cleaned state we will drag and drop that field in the filter pane of the sheet.
Right-click on the filter pane above Cleaned state à and select show filters.
Now we can see that the filter does not contain the two states which were excluded ( Georgia and Florida)
Many times we would like to combine two or more fields to subset the dataset and hence the below example shows how to subset from selecting from two-three dimensions.
Here we are considering three dimensions namely State, Ship mode and Category and we are taking the measure as quantity into consideration.
Please place the dimensions and measures as shown in the below figures.
Now for the data to be used as a customized filter select all the values above 250 by pressing down the control key and select create set as shown below.
Once the settings dialogue box pops up to rename the set as “Above 250 transactions” and remove all dimensions and measures and pull out the set named Above 250 transactions from the Set tab which is located at the left bottom side of the sheet.
Creating Set in Tableau allows you to isolate different segments of a dimension, and can then be used in a variety of ways to gain insights into your data. This post provides guidance on Creating a Set in Tableau as well as various ways (Creating Set in Tableau) that can be used to improve your analysis.
This has been a guide to the examples of Creating Set in Tableau. Here we have discussed the Different steps of Creating Set in Tableau of DataSet. You may also look at the following article to learn more –