Tableau Tip #2: Using a parameter to change the view in a dashboard (part 1)

by Bethany Fox

What are parameters?

Parameters are dynamic values that can be used to change the measures or dimensions in a view. In this blog, I will be showing how to use parameters to switch between different worksheets in a dashboard.

What do parameters look like?

Once you’ve created a parameter (which I’ll explain how to do shortly), you can show the parameter in the view by right clicking on it in the parameters section of the data pane, and selecting Show Parameter Control. All this does is show the different values of the parameter in a drop down box (you can change the view of the parameter to be, for example, a single select list). To make the parameter ‘work’, you have to create a calculated field which will connect the parameter to the data source.

How do I create/use a parameter?

Say for example, you have three views that you want on the same dashboard – a scatter plot, a bar chart, and a map – but you only want one to show at a time. This is one example where parameters are incredibly useful. First things first, create your parameter. It’s often a good idea to name your parameter with an instruction or a statement, as this is what will show in your final view, such as the one shown here:

change-view-param

The values you input here will be the values shown on the parameter drop down. Here I have named them after my worksheets.

change-view-cf
Secondly, create your calculated field. Here, as I will be using this to simply filter out the views I don’t want to see in my dashboard, my calculated field will simply be equal to my parameter.

 

Now, on one of your sheets, show the parameter control and select the option which corresponds to the view of the worksheet you are currently on, i.e. if you have shown the parameter control on the scatter plot sheet, then select ‘Scatter Plot’ on the parameter. Then, drag the calculated field corresponding to the parameter on to the filter shelf. As you have only selected one option in the parameter, there will only be the same option available to select in the filter pop up; tick this option and click okay. Finally, select the other options in the parameter in turn, and repeat the same steps for each corresponding worksheet.

After all this, you are finally able to create your dashboard! Drag a vertical container on to the sheet, and drag on each of your worksheets in to the container. Hide all the titles and colour legends – and you’re done! Watch the video below to see the above steps in action:

[youtube https://www.youtube.com/watch?v=AtBB1oxc-Q0&w=560&h=315]

The reason for hiding the colour legends in this, is because the colour legend corresponding to the worksheets that aren’t selected in the parameter will only show null values, like this (watch the colour legends):

giphy-3

Which leads on nicely to my next section…

For my next Tableau tip…

I will be looking at how to include a colour legend that also changes within the view depending on the current parameter selection.

How to be successful in the Data School

2 mins read

Thu 29 Dec 2016

What's the most challenging thing about the DS?

2 mins read

Thu 29 Dec 2016

Permissions in Tableau server: what are they and how do I use them?

3 mins read

Thu 01 Dec 2016

Tableau Tip #4: Using a parameter to change the view in a dashboard (part 3)

2 mins read

Tue 29 Nov 2016