How to use Parameter actions in Tableau Desktop 2019.2 and newer
Parameter actions in 2019.2 finally let users feed a selection straight into a parameter, and the value sticks after you deselect.
- Parameters are dynamic values mapped to data types (float, integer, string, boolean, date) that apply the same value to every row when used in a calculation
- Setting a parameter's value to zero lets a reference line hide along an axis until a selection feeds it a real value
- Parameter actions live under worksheet actions (or dashboard actions) and can change a target parameter using an aggregated metric such as average profit
- A selection updates the parameter and the value persists after deselecting, letting you compare a subset against the full data set
- You can layer a calculated field that colours marks based on whether they fall above or below the parameter value for dynamic visual feedback
0:00For many months and many years Tableau
0:06users have been asking for the ability to
0:08add some
0:08dynamism into parameter actions and finally
0:12in Tableau 2019.2 we have parameter actions
0:16.
0:16Now it's not quite what users were asking
0:19for but actually the combination of this
0:21and
0:21some other features that Tableau released
0:24throughout the year give us the capability
0:26that we need and actually goes well beyond
0:28that. Now in order to understand parameter
0:30actions
0:31it's worth understanding parameters in full
0:34. So I'm just going to do a quick refresher
0:36for new users
0:37on what parameters are. Parameters are
0:39essentially dynamic values. I'm going to
0:42create one right now
0:43by right clicking in this white space
0:45creating a parameter and you can create all
0:48sorts of
0:48parameters but they essentially map to data
0:51types. So you can see floats, integers,
0:54strings, booleans,
0:55date and date and time fields. Now these
0:58are essentially values that the user can
1:01input into
1:01the parameter. So if I for example call
1:04this number decimal and keep it floating
1:09but I type
1:09in 1.5 hit okay you'll see my parameters
1:13created here on the bottom left hand side
1:15and then what I can do with the parameter
1:18if I show that value you can see my
1:21parameter controls
1:22now here on the left hand side if I drag
1:25that into the visualization you can see I
1:27get 1.5.
1:29I can use it as a label there's 1.5. I can
1:32even put it on size that size is going to
1:35be 1.5 but
1:36ultimately that remains where it is and
1:39when I create a calculation with the same
1:41parameter
1:42what actually happens is that every single
1:45row of the data set is assigned that value.
1:48So if I call this param for short and hit
1:52okay then you'll see that if I drag
1:55parameter next
1:56to number decimal I get a totally different
1:58total. I get 10,616 because it takes a
2:02number of records
2:03and essentially multiplies that by 1.5
2:06because every single row has 1.5.
2:07So you can start to see how parameters are
2:10useful if I change this number here to let
2:12's say three
2:15then my numbers change you can see those
2:18those two changing okay so that's a very
2:20very brief
2:21introduction to parameters you can create
2:23lots of different ones with dates, booleans
2:26there's a
2:26whole range of things you can do but where
2:28it gets really powerful is when the user
2:31can actually
2:32change the parameter using something in the
2:34visualization. So to show you how the
2:36feature
2:36works I'm going to build a new chart. I'm
2:39going to clear my sheet by clicking this
2:41icon here on
2:42the top bar and then what I want to do is I
2:45want to draw a scatter plot showing all my
2:48products.
2:48So I'm going to drag product onto detail it
2:50gives me a waffle chart with all my
2:52products
2:53and then what I want to do is see the
2:55profitability and sales as a scatter plot.
3:00So profitability on the left, sales along
3:03the bottom and what I would like to also do
3:06is maybe
3:06put quantity and size so I can understand
3:08how many of their particular product I'm
3:10actually selling.
3:11So here we have a very basic chart now a
3:14typical thing you might do in a view like
3:16this is add
3:17some filters so I'll just right click on
3:19subcategory and I'll probably right click
3:22on
3:22region as well and show filter so those
3:25filters appear on the right hand side and
3:28something you
3:29might want to do is for example do some
3:31analysis and and sort of compare
3:33performance in different
3:34regions or across different subcategories.
3:37Now previously what you had to do before is
3:39you'd
3:40add a reference line I'll just show you let
3:42's add profitability reference on this side
3:45the average
3:46you'd go to your particular area central
3:50let's say and you'd hover over your average
3:52yourself 101
3:54then you go to south hover over that 73 and
3:56you'd probably write this down on a on a
4:00pen and paper
4:00and you know kind of work with that if you
4:03're a little bit more of an advanced user
4:05you might
4:06actually just create that as a table build
4:08out a dashboard and again the more advanced
4:10you get
4:11the more you start to realize that you can
4:13't possibly compensate for every single
4:16variant
4:17or question that's going to come from a
4:18business user. So this is where parameter
4:21actions become
4:22really really powerful so we're going to
4:23build something similar but we're going to
4:25do it a
4:25slightly different way. First I'm going to
4:27clear the reference line and we're going to
4:31just go back
4:31to our default view bring all our data sets
4:34back in. Okay the first thing I'm going to
4:37do is create
4:38a couple of new parameters okay not a
4:40calculated field a parameter let's create a
4:43parameter
4:44and I'm just going to leave them as one
4:46actually I'll leave them as zero this is a
4:49little trick
4:50because I want them to hide along the axis
4:53so let's call this profit param
4:59and I'm going to create another one I also
5:02want that to hide on zero and I'm going to
5:06call this
5:06sales param probably figured out what I'm
5:10going to do now so on the profit axis I'm
5:13going to add
5:14a reference line and I'm actually going to
5:17you know call out that profit parameter and
5:20it's going
5:20to be sitting on zero because the value of
5:23the parameter is zero. Now some of you
5:26might be
5:27watching this and be asking well can you
5:29have not created the parameter here yes you
5:31can you can
5:32actually create parameters right from the
5:34reference line window but I just did it
5:35outside just to
5:37allow new users to sort of keep up so here
5:39we are I've done the profit parameter I'm
5:42going to add
5:43another reference line I'm going to bring
5:46in the sales parameter as well that's
5:48hiding on the axis
5:49it's very nice I'll just make these a
5:50little bit thinner I'll edit that and I'll
5:54actually do that
5:56here as well great so you can see that
5:59these parameters are hiding on the axis and
6:02just to
6:02prove to you that they're working let's
6:04show those values and let's type in
6:06slightly different values
6:07let's type in let's say 100 and if you hit
6:10enter you'll see that that line moves the
6:12axis is quite
6:13large so maybe we need a couple more zeros
6:14for you to notice the change there we go 10
6:16000 you
6:17can see that value is moving and I see but
6:19let's set that back to zero okay now the
6:23new thing here
6:24if I go to the actions menu now notice I'm
6:27going to the worksheet actions if I was
6:29doing this in
6:29a dashboard I'd need to go to the dashboard
6:32actions but here I'm working in a worksheet
6:34so I go over to the worksheet actions okay
6:36and you can actually see a parameter that I
6:39created
6:40prior to this video so let me just remove
6:42that and let's add an action and you can
6:45see the first
6:46option here is to change the parameter so
6:48this is a new feature so I'm going to
6:51change the profit
6:52parameter okay profit param okay and the
6:56target parameter here is a profit parameter
7:01and what I
7:02want to feed into that profit parameter is
7:06a particular value okay and I have to be
7:09careful
7:10here because if I choose sales for example
7:12then it's going to take whatever
7:14aggregation of sales
7:15and put it in the profit parameter which is
7:18the wrong thing I don't want to take the
7:20sales value
7:20the average sales value for example and
7:22apply it to profit because those are two
7:24very different
7:25kinds of numbers so let's hit profit and I
7:28'd like to take the average profit okay and
7:32hit okay
7:33so I've done that but nothing's happened
7:37where this comes into effect is when the
7:40user makes
7:41a selection so now watch what happens when
7:43I click and drag on these three items the
7:46profit
7:47parameter moves to reflect where the
7:49average is between those three records and
7:52the really
7:52powerful thing here is that when I deselect
7:55it stays where it is okay so let's repeat
7:58that step
7:59for sales let's add an action this time we
8:02're going to change the parameter again but
8:06this
8:07time we're going to change the sales
8:08parameter it's good to get into the habit
8:10of naming your
8:11parameters I need to make sure I choose the
8:15right metric and aggregate that in the
8:19correct way okay
8:20if I wanted to I could actually change the
8:23way that action is applied I could maybe
8:25use a hover
8:26or a menu option I can actually make this a
8:29menu option if I wanted to so I'm going to
8:31stick to
8:32select so now you can see I have two
8:34parameter actions and click okay if I
8:37select the same three
8:40I now get the average sales and the average
8:42profit I can see roughly where they
8:44intersect
8:45and when I deselect that stays where it is
8:49okay so where this becomes a really useful
8:51feature
8:51if I reset these parameters just I set
8:54these to zero
8:55let's say user opens a dashboard this is
8:59what they see and they want to do some
9:03analysis they
9:03want to do some sort of you know comparison
9:06so I'm first going to deselect everything
9:08and just bring
9:09in binders okay then I'm going to do a
9:11shortcut I'm going to hit command a or
9:14control a and windows
9:15and you're going to see the values sort of
9:17pop up then I'm going to bring the rest of
9:19my data set
9:20back in you can immediately see that even
9:22though I've brought my data set back in
9:24what I'd selected
9:25before stay selected but I can now deselect
9:28and see how that sits with the entire data
9:31set
9:31you can get even more advanced because what
9:34we can now do is create another calculated
9:37field
9:38that colors based on how a field a number
9:42behaves relative to our parameters so let's
9:46let's check if sum of cells
9:49is greater than the which one are we doing
9:56here this is a profit one
9:58oh well some cells shouldn't be checking
10:01profit should we should be checking sales
10:03sales parameter
10:04okay so we're just going to do color check
10:09okay click apply and now if I drag that
10:13onto color
10:14you'll see everything underneath the cells
10:17parameter is correctly colored blue and
10:21everything
10:21above is colored orange I can change these
10:24colors so I could say actually everything
10:27underneath is
10:29sorry everything under is red and
10:32everything above is not important so I can
10:35just do that
10:36so now as I interact with this as the
10:39average changes you can start to see how
10:42dynamic this is
10:43and this becomes really really powerful if
10:46you start to apply it in lots of different
10:48use cases
10:49before I close out the video I just want to
10:52show you some examples from the Tableau
10:54community
10:55in the past I showed you an example from
10:59Mark Reed a Tableau enthusiast in the
11:01community and
11:02today I'm going to show you an example from
11:05Lindsay Poulter now her work is incredible
11:09because if you
11:09look at her workbooks and the way she
11:11builds interfaces for Tableau she's using
11:14set actions
11:15parameter actions to give interfaces that
11:18look natural and normal and she's not
11:20always using
11:21the Tableau interface item so let's have a
11:23look at this so you can see here that you
11:25've got
11:26accessories binders and bookcases selected
11:28and essentially what's happening here is it
11:30's feeding
11:31those values here into the chart so I can
11:34see how the colored items compare to those
11:38that aren't
11:39selected so I can compare the two titles I
11:41get a readout of what's selected along the
11:43top and I
11:44also get this sort of nice interactivity to
11:47show me what I've selected it's very
11:48different compared
11:49to the drop down selector in Tableau and it
11:52looks a little bit more authentic this is
11:54just some of
11:55the power you can apply with parameter
11:57actions I highly encourage you to see some
11:59of the examples
12:00out there I couldn't possibly cover every
12:02single one of them in this video but it's
12:04definitely
12:05something to investigate if you're looking
12:07for dynamism in your Tableau workbooks and
12:09or you
12:10think letting the user interact with your
12:12visualization with dynamism is going to
12:15help
12:16with their analysis if you enjoyed the
12:18video please subscribe if you didn't
12:21drop a comment let us know the kind of
12:23content you'd like to see
In 2019.2, you now have the ability to visually change a parameter’s value. What does this mean? watch the video for a brief glimpse of what’s possible but as they say “Sky’s the limit” with what you can do with this feature.