Comparing Sets vs T|F Calculated fields

  1. Sets are similar to a True|False calculated filter that identifies records that are IN vs OUT of the selected set criteria. The same results can often be accomplished simply using T|F filter calculations.

  2. Some significant differences between T|F calculated fields and Sets are:

    1. With Sets, you can dynamically select which records are in or out of the Set. You can’t do that easily with a T|F Calculated field.

    2. Set logic processes before any dimension filters process, like FIXED LOD calculated fields, whereas T|F calculated fields process after dimension filters.

  3. Sets have more functions available in the Tableau Desktop app, but they are still a useful tool in the Web App.

Using Sets in the Tableau Web App

  1. A common way to use sets is to dynamically select a set of data without excluding other data, since the set only states if a record is IN or OUT of the set criteria.

  2. The first step is to create a Set. In this example, create a Set for the Customer field.
    Right click on the Customer field and select Create > Set.

  3. Once you have created a Set, there are three methods to select the records for your set.

    1. The Shortcut Menu has options to create a set, add to set, remove from set.

      Shortcut menu set options

    2. Check the option Show Set to show the set selection list on the right.
      Tableau help link:
      NOTE: The Set field needs to be on the worksheet in some manner in order to show it.
      You might mark it as a detail, color, or tooltip to have it on the worksheet.

      Select the Show Set property to select members from a list

      You can also check Show Filter on the Set field to select records in the set or out of the set.
      DataSelf Example: Example 01 Show Set Control - DataSelf Analytics

    3. Using Worksheet Actions enable you to dynamically choose the members of a set by clicking/highlighting rows. Tableau help link: Set Actions - Tableau
      DataSelf Example: Example 02 Worksheet Set Actions

      1. Create your Set. In this scenario we are using the Customer Set previously created.

      2. Click on the Worksheet Menu and select Actions topic.

      3. Add an Action to Change Set Values when selecting the Customer Set field on the worksheet.

Click on the Worksheet Menu, Actions

Add action to Change Set Values

Choose the action options

d. In the example below, the Customer Set field is added to the Rows. It’s standard field label is IN/OUT(Customer). When you click on customer records, they are added to the IN group of the Set, based on the action settings. To clear the set selection, click twice on the IN label to first add all records then clear all records.

Using Sets for selective drill-down

With the hierarchy drill-down function, when you expand a hierarchy, it does it for all the records, not just the one highlighted. But you can use Sets to create a drill-down feature that expands only the highlighted record.

DataSelf worksheet link: Example 03 Sets for Drilldown

In this example the Item Class field is displayed on the worksheet. The goal is to double click on a specific Item Class and list all the items in that Class.

  1. Create a Set for Item Class. No Item Classes have been selected to be in the Set yet.

  2. Add the Item Class Dimension to the Rows section of the worksheet.

  3. Create a Calculated field with the formula If [Item Class Set] Then [Item] Else '' END
    This formula states if an item is in the selected Item Class, then show the Item, otherwise display a blank.
    In this example the calculated field was named Item Class - Item.

  4. Add the Item Class-Item field to the rows section of the worksheet.

  5. Create a Worksheet/Action to Change Set Values

Create a Change Set Values worksheet action

Set Actions will Assign values to set. Clearing will remove values

6. When an Item Class is click/selected, it is added to the Item Class Set. Then the Item Class-Item calculated field displays all the Items in the set.

When click on CONSUMER 100BABY that Dimension value is added to the Item Class Set

The Item Class-Item calculated field displays all Items in the selected CONSUMER 100BABAY Item Class Set.