Tableau How To — Cross Highlight Using Set Actions

This week’s Tableau #WorkoutWednesday goal was to build a cross-highlight table using set actions. A recently released new feature, set actions allow you to dynamically add or remove dimension members to or from a set. So far, some common application focus around formatting, drill down, and comparisons that render on your viz dynamically based on user interaction.

Week 45 #WorkoutWednesday Goal

To build the above cross-highlight table requires a few steps. The first component I built was a dynamic Y Axis and X Axis parameter/calculated dimension combination. A parameter is created with a fixed string value list of Region and Segment. In the calculated field, you can then use the parameter to determine which dimension should be displayed on the viz. The Y Axis calculated field is done in a similar fashion.

Step 1: Parameter and Dimension Choosers

The next step involved creating two sets, one from the X Axis calculated dimension field we just created and one for the Y Axis.

Step 2: Create Corresponding Set Fields

I added a dimension value to each set for some testing…the “Central” Region and the “Art” Sub-Category. One additional calculated field is needed before building our viz, a Highlight Flag. It evaluates whether a row of data is in the Y Axis Set or the X Axis Set and assigns a value (1 or -1). The purpose of this field is to give the viz a flag to utilize for color.

Step 3: Create a Highlight Flag

Now that we have all the required pieces in place, time to build the viz. Tableau’s “Show Me” pane includes highlight tables out of the box. We’ll be using a variation of this to build the viz.

Step 4: A Standard Highlight Table

Instead of using our metric to color the highlight table, we’ll use the flag we created that tests whether a row is in one of our sets. At this point I still have the Central and Art values in the set. Changing my rows and columns to the dynamic dimension calculated fields, SUM(Sales) to a MAX of our Highlight Filter, and changing the color range from -1 to 1 gives the following viz (almost done).

Step 5: Highlight Table — Before Set Actions

After adding this sheet to the dashboard, we can incorporate the new set actions feature to dynamically change the set memberships. Instead of the hard-coded Central and Art members we used to test, hovering over any region and sub-category will change the set membership and therefore the color highlighting.

Step 6: Add Set Actions

The final result looks something like the viz below. As you hover over a value, it is added to the set and therefore colored on the highlight table.

Final Viz

Hopefully this was informative and helpful to those looking to improve their Data Viz and Tableau skills. Post a comment, I’m happy to address any questions.

I’ll be adding more content throughout the duration of the #NovemberDataChallenge and #WorkoutWednesday to both Tableau Public and LinkedIn.

Data Analytics & Viz

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store