Set Control in 2020.2 – Three Main Configurations






Tableau 2020.2 just released last week.  Ken, having been a DBA and spending a lot of his time with data architecture, gravitated to the new data model.  Check out his blog post for more information on this game-changing feature.  I, on the other hand, was drawn in by the improvements to one of the most powerful features ever released in Tableau, set actions.  So let’s check it out.


Showing a Set

The first thing I should mention is that you are now able to "show a  set" and use it like you would a normal filter - yet that "filter" allows you to add values to a set.  All you need to do is to right/click on a set pill and choose "Show set".  Check out the below gif to see how it works.  


This is a huge addition to sets and will be incredibly powerful.  However, in this blog post, I am going to focus on how the new options improve set actions.  
  

Set Actions Before 2020.2

Let’s first talk briefly about how set actions worked prior to 2020.2.  (For a full explanation, check out the following article on Tableau's website).  To explain this, let’s use the example of proportional brushing with a bar chart and pie chart.  In this example, we are able to select sub-categories from the bar chart in order to add them to a set then display the percentages in the set within the pie chart (yeah yeah, I’m using a pie chart J). 





In order to set up these set actions, you had the following options under the Dashboard Actions -> Add Set Action menu:


Here you would choose the source sheet, how to run the action (hover, select, menu), the data source, and the target set.  You would then decide what happens when you “clear the selection”, which really means clicking the white space outside of the chart (in our example, clicking on the white space outside of one of the bars).  You could keep set values (which would keep the values you had selected), add all values to the set (which will add all the values to the set – in our case, all the sub-category bars would be selected) or remove all values from the set (which would remove all values – in our case, all the sub-category bars would be unselected).

Once that was set up, when interacting with the visualization, you could add values to the set in a couple different ways.  You could simply click on a bar.  Doing so would add that single value to a set.  You could also multi-select values in the bar chart by dragging out a selection with your cursor (to select adjacent bars) or by pressing and holding the CTRL key to select whatever bars you like.  The key to this is that the selections all had to happen at the same time.  But what if you used the CTRL key to select seven bars then realized you selected the wrong one?  Or what if you really wanted to explore the data and wanted to add some values then remove them?  In order to do this in past versions, you’d have to clear the entire selection and start from the beginning. 


Set Actions In 2020.2

You probably guessed by my subtle foreshadowing, that the aforementioned issue has been resolved in 2020.2 as Tableau has given us even more control over our sets via Set Control.  Set Control allows users to incrementally add or remove values from a set therefore improving the way we dig in and analyze our data.  This means that you can add values to a set, go explore the data using that set, then come back to it and add or remove values without starting over or without pressing and holding the CTRL key.  It gives your users so much more flexibility and a better user experience as they try to “see and understand their data”. 

So how does it work?  Let’ first look at the new options in the Dashboard Actions -> Add Set Action menu:




The options are very similar to before.  You are asked to choose the source sheet, how to run the action, the data source, the target set, and the impact of clearing the selection.  However, Tableau has also provided us with a new section labeled “Running the action will” – which is highlighted above.

The option of “Assign values to set” provides you with the exact same functionality that previous versions did (which I described above).  The next two options, however, are brand new and splendacious!

If you choose “Add values to set”, this allows you to incrementally add values to a set.  In our example, you can click a bar to add it to the set, go explore the data, come back and click another bar to incrementally add it to the set.  It will not remove the first item from the set; it will simply add that value to the set – leaving you with two values in the set.  You can continue to do this without holding the CTRL key.  Just keep clicking on bars and it will keep incrementally adding them to the set.  Let’s assume you’ve set the Clearing action to be remove all values from the set, when you are done adding values to the set, you would simply click outside of the bar to remove everything.

You’ll probably guess that the third option “Remove values from set” will essentially do the opposite.  You click on a bar that is currently in a set and it will remove that value from the set.  Like the Add option, you can do this incrementally without a group selection or pressing CTRL. 


Three Main Configurations

In working with these new Set Action / Set Control options, I believe that there are three main configurations.  These configurations are 1) Add and Clear All, 2) Remove and Add All, and 3) Add & Remove on Menu, which is my favorite and in my opinion, the most flexible.  Disclaimer: people are going to come up with all kinds of crazy cool options.  I’m not saying these are the “end all be all”, I’m just suggesting that these will be the three main configurations that people utilize in their day-to-day activities. 

Before I explain each of these, please check out the corresponding visualization where I utilize the example of proportional brushing (noted above) using these three configurations.  To navigate within the viz, just click the buttons at the top.  Please note that when you move from one option to the other, you will most likely need to clear the action first by clicking the white space outside of the bars.

1) Add and Clear All: 

This option will allow you to incrementally add values to a set (again, no selection box or pressing CTRL) then remove all values from the set by clicking outside the bars, in the white space.  To set it up, you’ll of course need to create a set and put that set on color for both the bar chart and pie chart (which I’m assuming you’ve done already and if you have not, just use my example workbook).  To set up the dashboard actions, just create one set action (call it Add Values).  Choose the source sheet (the bar chart – Sub-Category Sales), set it to run on Select then choose the data source and the set.  Now the two key selections will be “Add values to set” and “Remove all values from set”.  Try it in my example viz.  You’ll be able to incrementally add values to the set then remove all of them by clicking outside of the bars. 




2) Remove and Add All:

The next option will essentially do the exact opposite.  Instead of adding and clearing all, you will be removing and adding all.  You will start with all values in the set and clicking on bars will remove those values from that set (and again, you can do this incrementally).  Clicking outside of the bars will then add everything back to the set.  You probably understand the dashboard action setup without me showing you, but you’ll simply set it to “Remove values from set” and “Add all values to set”:




3) Add & Remove on Menu:

Okay, this is my favorite configuration as it is the most flexible (drum roll please) as it gives your users the ability to either add OR remove values to and from the set.  If you check out in the example viz, you’ll see that clicking on a bar reveals options in the menu to either Add Values or Remove Values.  If you choose Add Values, it will add that sub-category to the set.  If you choose Remove Values, it will remove it.  And like before, it will do this incrementally. 

To set this up, you will need to create two dashboard actions.  We will call them Add Values and Remove Values.  Add Values will be set to “Add values to set” and Remove Values will be set to “Remove values from set”.  Both will be set to run the action on Menu.  This is very key because if you set them to run on Select or Hover, Tableau will essentially just choose one of them to run – it can’t run both.  I’ve opted to set both of them to “Keep set values”.  You could choose to add all or remove all, but the key is that they both need to be the same, else Tableau will just pick one. 



With this configuration, your users can click and choose what they want to do, either add the value to a set or remove the value from the set.  If your users make a mistake, they can easily reverse that mistake.  It gives your users full control.


Wrap-Up

Okay, that’s basically it…a quick introduction and a few key configurations.  I absolutely cannot wait to see what the community comes up with, especially Lindsey Poulter J.  Before you go, I’d recommend you check out two different blog posts from Tableau dev, Filippos Lymperopoulos.  The first is an introduction to Set Control and the second is a Set Control hack.

Thanks for reading and let me know if you have any questions.

Kevin Flerlage, May 11, 2020



9 comments:

  1. In Filipios's blog posts, he access the JavaScript. How? Can regular users do that?

    ReplyDelete
  2. Love following you guys!! AMAZING! And Thank you!

    ReplyDelete
  3. Hi Kevin. Is there a way to make the Set Action work if you add Ship Mode to columns, such that the user can select a specific intersection of Sub-Category and Ship Mode, versus all of a Sub-Category?

    ReplyDelete
    Replies
    1. I'd be happy to help. Any chance you could email me a twbx with an explanation of what you are trying to accomplish? Flerlagek@gmail.com.

      Delete
    2. Looks like Sue asked this question on the forums and I think she's all set now: https://community.tableau.com/s/question/0D54T000019SLSUSA4/set-control-with-multiple-dimensions

      Delete
  4. Is there a way to set on button to clear the set actions or select all?

    ReplyDelete
    Replies
    1. Yeah, probably. If you want to email me at flerlagek@gmail.com, we can give it a go!

      Delete

Powered by Blogger.