While using maps, we sometimes want to show multiple colors for a single dimension on it. Let’s say, top 5 and bottom 5 states by profit in a country. An easy way to do this is by creating sets which means having a subset of data of top 5 and bottom 5 states by profit.

What are sets?

Sets are custom fields that are created within Tableau Desktop based on dimensions. They can be used to compare and ask questions about a subset of data.

There are two types of sets:

  1. Dynamic: The values/members in the dynamic sets change when the underlying data changes.
  2. Fixed: The values/members in fixed set do not change when the underlying data changes.

I’ll be using Sample superstore data-set. Connect to the set and open worksheet.

  1. We want to show the top 5 and bottom 5 states by profit. Let’s make two separate sets.

 

  1. Right click on States and select Create > Set. Use the Top tab to define limits on what members to include in the set. Choose top ‘5’ States by ‘Sum’ of ‘Profit’. Rename your set to ‘Top 5 States by Profit’.

  1. Make another set for ‘Bottom 5 States’ by ‘Sum’ of ‘Profit’. When finished, click OK.

  1. The new sets are added to the bottom of the Data pane, under the Sets section. A set icon https://onlinehelp.tableau.com/current/pro/online/mac/en-us/Img/symbol_group_schema.png indicates the field is a set.

  1. In order to use these sets to colour our map, we need to create a calculated field.

  1. Drag the calculated field to colour. Change the colours according to your preference.

  1. It would be good to have labels of these States on map for it to make more sense. Let’s create a calculated field for it and drag the calculated field to Label on Marks Card.

And our map showing two sets of states by profit by different colours is ready!