Parameter Actions (Hands-On!) in 3̶0̶ 45 Minutes

In a year of great new feature releases for Tableau, parameter actions are the single most powerful and versatile addition. In fact, one might say they have a number of superpowers that allow them to accomplish a variety of useful functions. This post aims to explain when and how to use parameter actions, by going through their superpowers one by one and explaining the ways you can use these superpowers. Along the way, I’ll discuss differences between set and parameter actions, when you’d use parameter widgets (controls) versus parameter actions, and the awesome but somewhat unheralded new ability that prevents your parameters from getting out of date.

There’s an accompanying workbook with the examples used in this post, plus step-by-step instructions to creating 4 different views using parameter actions. You’ll need Tableau Desktop 2019.4 or later to open the workbook. All the examples use Tableau’s built-in datasources (either superstore or World Indicators).

I’ve adapted this guide from a talk I gave at the Boston Tableau User Group originally titled “Parameter Actions in 30 Minutes”, but I guess that time was a bit optimistic in reality.

Many thanks to Kevin Flerlage, Ken Flerlage, Lindsey Poulter, and Bethany Lyons, whose writings and workbooks inspired and informed much of the content herein.  Thanks to Jessica Yan for helpful comments when previewing this presentation.


This diagram is based on a similar one by Bethany Lyons

Filter, set, and parameter actions have the same general workflow: the user selects, hovers over, or menu-selects one or more items on a view, and that/those selection(s) are captured in an item (a filter, set, or parameter) where they are used for different purposes. Filter actions are only able to create filters. The amazing thing about set and parameter actions is that the selections can be referred to in calculated fields, and can then be placed anywhere in a view – on filters as well as columns and rows, pages, mark properties (color, size, text, detail, and tooltips), and even reference lines.

While set actions and parameter actions are very similar in the way mentioned, a major distinguishing feature is that sets can contain multiple values at one time, while parameters contain one and only one value at any given time.

undefinedSuperpower 1a: The ability to refer to user selections in calculations, and on shelves and cards

undefinedSuperpower 1b: The ability for the user to change selections without leaving the viz

The first set of examples (the yellow tabs in the workbook, through EXERCISE 1) actually demonstrates the two most fundamental superpowers of parameter actions, which were shown in the diagram above. The use cases that demonstrate these most clearly are those where the user hovers over a mark on a graph, and marks with that value are highlighted or otherwise customized in some way. These customizations of the indicated mark include showing more information, changing the size or shape, adding highlight color (much more customizable than the built-in highlight action), or highlighting all the marks that have the same dimension value as the indicated mark.

What’s happening behind the scenes is that the user hovering over the mark triggers the previously created parameter action, which tosses the value of the field specified in the setup (e.g. the particular sub-category value) into a bin that can hold a single value (the parameter). This parameter value is referred to by calculations placed on the color, size, label, etc. properties of the viz, so that these properties change for different marks as the parameter value changes.

Go ahead and play around with the first set of examples. Note that while you technically could accomplish the parameter value change by having the user select a value from a parameter widget, it would be a completely different, and inferior, workflow for the user. They’d have to leave the viz to make the selection, instead of having the selection happen organically as they explore. In addition, since hover selection inherently selects only a single value, I favor using parameter actions over set actions, which can hold multiple values and can be (in my opinion) less straightforward than parameter actions when working with a single value. Therefore, for these kinds of use cases I think parameter actions are the way to go.

The last example in the set is one in which the user can click on the graph and set the reference line to that location. There are 2 special features of this particular example – first, it shows that numbers can be used in parameter actions just as well as text, and second (if you dig into how it was made), the parameters can be referred to directly in the reference line dialog – no need to wrap it in a calculation.

Setting up Parameter Actions

EXERCISE 1 will guide you through creating a scatterplot of Sales versus Profit by State, whose marks change shape, get larger, and show a label when a user hovers over the mark. There are very detailed step-by-step instructions in the workbook, which I won’t repeat here. However, this is a good time to go over the high-level summary of how to create parameter actions:

  • Create the view(s) (sometimes there’s a separate source view)
  • Create the parameter
  • Create the parameter calculation(s)
  • Add the parameter calculation(s) to the view(s)
  • Create the dashboard, if necessary
  • Create the parameter action (Worksheet > Actions or Dashboard > Actions)

One basic calculation is used again and again in these vizzes – a simple “Is Selected Field Name that is defined as Field = Field Parameter Value (e.g. calculation “Is Selected Sub-Category”, defined as [Sub-Category] = [Sub-Category Parameter]). This creates a boolean field. If you drag that onto color, size, etc., you can define your settings for the selected parameter value versus everything else (TRUE versus FALSE). Label calculations have a slightly different form, e.g. the sub-category label is defined as IF [Is Selected Sub-category] THEN [Sub-Category] END

Go ahead and walk through EXAMPLE 1. The steps here are very similar in all of the exercises.

undefinedSuperpower 2: The ability to use values not specified by any field in your datasources

Sets are inherently tied to a field value in your datasource; they are created from a particular field, and they can never contain values outside of that field. Parameters, on the other hand, can be created from any list of values you desire (or no list at all, as we’ll see later), even if they’re just typed into the setup dialog. Parameters don’t “belong” to any one field or datasource; they “belong” to the entire workbook, and can be invoked to influence vizzes from any datasource in a workbook.

The major use cases for this are chart swaps, date range selection, toggling annotation, etc. – cases where users customize their viewing experience. Examples are in the red tabs of the workbook. The values for these parameters — “Bars” versus “Line” for the chart selection, “Last Year/Month/Week” for a date range selection, etc. — are defined separately from your datasources.

You might have already accomplished such actions using parameter widgets, which is still a viable option here. It’s easier to set up than parameter actions – all you have to do is define your list in the parameter setup screen itself. And since you need a separate view anyway to create your buttons for the parameter actions, the user experience of going outside the target viz to click a widget selection versus a button is pretty similar. However, parameter actions do allow you to use prettier, customized buttons for your selections. And as Ken Flerlage pointed out, this isn’t just cosmetic in many cases; for example, on mobile the parameter widget options can be difficult to select. I’ll call these use cases a tossup between parameter widgets and actions depending on the exact use case, with set actions not really a viable option here since they’re tied to one field in one datasource.

The extra step you have to take is to create the buttons on a separate sheet. Perhaps counter-intuitively, you can’t use the parameter list itself to create the buttons, since you can’t drag parameters onto rows/columns, and even if you could you would only see one value at a time. You need the ability to create ALL your buttons at once. Luckily, there’s a very easy way to capture a list of items whose members can all be displayed at the same time – it’s to create a (tiny!) datasource to store your values. (I’m not thrilled that it clutters up my datasource list for a few values, but that’s not a big problem). First list your values, one per line with a single-word header at the top, in your favorite text editor. Copy that list, and paste it into a blank worksheet in Tableau. A new datasource (with a name like “Clipboard_1234”) magically appears in the datasource list, containing your field and all of its values. Rename the darn thing to something useful, and go ahead and use that sheet to make your buttons, which can be as simple as circles with text, or customized using button shapes on the shape pallet. Go ahead and try it with EXERCISE 2.

One last comment about creating the parameter action – while by default the scope of a new parameter action is set to the dashboard you’re creating it on, you can change it to a datasource or even the entire workbook by changing the selection in the dropdown shown. “All” means the parameter action can be triggered from anywhere in the book; if you select this option, you can further customize the exact worksheets and dashboards they apply to (be aware that sheets created after the parameter action creation automatically get checked off on the list; you can go back and change the selections). Here I selected the buttons’ datasource, so that I don’t have to make a new parameter action each time I want to use the buttons, but I don’t have to worry about unchecking boxes for new sheets.

undefined Superpower 3: The ability to allow the user to make their selection from a view that contains more information than a parameter list.

Both of the views above allow the user to select a country and then view the percent of total world population and CO2 emissions for that country. The parameter widget on the left certainly allows the user to select a country from a list. But which countries do they want to choose? All they have to go on is the name of the country, so finding interesting items is just a shot in the dark of clicking around until something interesting is revealed. In the view on the right, the user selects countries from a map that already color codes the relative CO2 emissions from each country. So they immediately might want to look at the United States with the darkest color, and clicking would reveal a percent of total CO2 emissions far higher than the percent of total population. Or China, whose percents of total are approximately equal. With parameter actions, the selection tool is an inherent part of the user’s exploratory experience, and makes for more organic and efficient user workflows on the dashboard.

The examples in this section of the workbook (blue tabs) are the types of use cases you’re most likely to find you use at work over and over again. The user selects a dimension value from one view, and a value for that dimension value is compared in some way with all or other values in the same or another view. You can’t use a filter action, because you need the values outside of the selection for the all/other comparisons. The examples here — percent of total, proportional brushing (selected dimension values magnitude versus total magnitude), selection 1 versus selection 2, difference (or percent difference) from average of the selection — were adapted from Bethany Lyons excellent blog post about set actions. Needless to say, either set actions or parameter actions can be used, depending on whether you want multiple or single selection. However, for the reason explained above, the parameter widget is a poorer choice.

EXERCISE 3 should feel pretty familiar to you by this point – no new surprises for setting up this use case.

Superpower 4: The ability to put any value into a parameter, even if it’s not defined when the parameter is created.

Did you ever use a parameter in a dashboard, and then later have to revise the workbook because the parameter list was out of date? I certainly have. Previously you had to create your list when creating your parameter; you could add values from your field of interest, but they don’t update from the field automatically, so you could find yourself making trivial updates. At last month’s Tableau Conference, DevsOnStage announced that automatically updating (dynamic) parameters will come out next year – yay!!! But it turns out that if you use parameter actions instead of parameter widgets, the future is now.

Instead of selecting “List” under allowable values, you can select “All” (see picture at right above). You don’t need to define your values ever – when you set up your parameter action, the field value you specify is sent over into the parameter bin. That’s it! With parameter actions, you already don’t need to worry about lists getting outdated. So if you’re using parameter actions and not widgets for values related to datasource fields, I recommend using the “All” option. The use case goes solely to parameter actions here — not set actions or widgets.

Wait, aren’t we entering the Wild West here? What’s to prevent you from sending over values from many different fields into the same parameter? Well, nothing will prevent you from doing that – you’ll have to self regulate. 🙂 Name your parameters and parameter actions clearly so you don’t get confused. I couldn’t think of any use case where you’d want different fields going into the same parameter. If any readers of this blog can point to one, I’d love to hear about it!

However, Kevin Flerlage did have a use case for using a button to add a value into a parameter that doesn’t match any of that parameter’s intended field values. He used a “NONE” button that sends the value “NONE” into a parameter; since “NONE” does not match any values for that field in the datasource, it effectively clears out the parameter. What a clever way to use the new “All” feature! The last section of the workbook (teal tabs) include both Kevin’s (reproduced) example, as well as EXERCISE 4 that leads you through a slightly different usage of the NONE button. It’s interesting to note that since you can manually type any string, including “NONE” (you need to include the quotes), into the Marks section of a worksheet, it’s not even necessary to have any datasource fields on your NONE button source worksheet at all, as in the example in the workbook.

Conclusion and Acknowledgements

So that’s it in a nutshell! This is my first instructive blog post, and I appreciate any feedback you have.

Many thanks to Kevin Flerlage, Ken Flerlage, Lindsey Poulter, and Bethany Lyons, whose writings and workbooks inspired and informed much of the content herein.  Thanks to Jessica Yan for helpful comments when previewing this presentation. And of course thanks to Will, Dustin, Kate, and the rest of the Boston TUG community for giving me my first opportunity to present. I had a blast, and I hope there’s more opportunities to help out down the road!

The superman icon was obtained from Flaticon.

The Tableau Community

Adam Mico asked me to write about what the Tableau Community means to me. That inspired me to create a blog and make this piece my first post.

            I used to roll my eyes at the thought of identifying myself with any corporate product.  I have friends who love Apple and would wait in line for new iphones when they came out; or who love Disney and go there again and again as adults.  While I respect my friends and appreciate the value of beautiful technology or movies, I never quite got why they *felt* so strongly about an entity that is simply selling products.

            So I’m surprised to discover the fierce warmth and loyalty I do now feel for the Tableau community, which has given me so much in recent years, and which I hope to support to my utmost ability.  It took the amazing and selfless contributions of many, many people for me to finally realize that a real community could, in fact, be centered around a company and a product.  First off it was Andy Kriebel and Eva Murray contributing hundreds of hours to run Makeover Monday, a community project that has allowed me (and so many others) to improve enormously in my Tableau and data visualization skills.  They are relentless contributors, motivators, and teachers, who work tirelessly week after week to create a structure that I know has made a huge difference in my own work, and inspired me to work on projects I’m incredibly proud of and would not have done otherwise.  Andy and Eva are the gatekeepers for my Tableau community experience, and I can’t thank them enough.

            I soon realized that after Andy and Eva, it’s selfless contributors all the way down.  It’s Viz for Social Good, Project Health Viz, Sports Viz Sunday, Iron Quest, and other community projects run by hard-working and talented volunteers, which develop skills and often help worthy causes.  It’s innovators creating new visualization techniques like Kevin Flerlage’s “no polygons”, Neil Richards’ petal chart, Alexander Varlamov’s animated parliament chart, and so many others just in the last year or so, all of whom have freely shared their new techniques.  It’s bloggers like Lindsay Betzendahl, Rosario Guana, and Ken Flerlage, to name just a few, who take time to explain techniques and even develop and share templates to make complex chart creation easy.  It’s all the people who take the time to give me feedback on my Makeover Mondays.  It’s all the people who post answers to Tableau questions on the community site so that when I google a Tableau question at work, I get an answer 99% of the time.  It stuns me how many talented and busy people put so many hours into helping me (and others) out.

            The thing that really cemented the community aspect for me was meeting all the people I knew through twitter at my first Tableau conference last year.  They recognized me, and seemed happy to see me! That was the best feeling in the world.

            Even though we all live in the Boston area, I first got to know Kate, Paula, and Michelle through Makeover Monday/twitter, which led to us meeting in person at the Boston TUG.  That has led in turn to getting to know other Boston TUGers and deepening my involvement.  As someone who doesn’t do well in large rooms of people I don’t know, I really appreciate having folks I know and who welcome me; I hope I can do the same for other folks I don’t know.

            The Tableau community is special, and I appreciate the things that Tableau has done to encourage this community to grow.  Salesforce, please don’t mess it up!

Create your website with
Get started