Tableau is a very flexible tool for creating dynamic data visualisations. The key to this flexibility is the “parameter” feature. Parameter in Tableau is a value/list of values that users can customise. For instance, users can create a pre-determined list of text/string values of the column names of continuous data such as “Profit”, “Quantity”, “Sales”, or users can create a parameter that allows a number/integer to be inputted by the end-users.

These parameter values can then be applied in a variety of ways. For example, with the “input an integer number” parameter, users can create a function to make a minimum value threshold (think about highlighting sales above a certain $). This can then be implemented as a dynamic reference line in the chart. The great thing about this is, end-users can change the value of the parameter to whatever they wish to!

Another example with the “pre-determined list of column names parameter” is to apply this parameter as the axis of the chart. This way, end-users can create their own chart of their interest. For instance, X-axis can be selected to “Sales”, and the Y-axis to “Quantity”, then if the users want to explore a different relationship, they can swap the X-axis to “Profit” instead.

Now that we understand the potential use of parameter as a “dynamic” tool, let us dive into the “how” to implement this in 3 simple steps.

1.) Create the parameter.
On the data pane, click on the drop-down arrow button that is located to the right of the search bar (see image below).

 

Enter the name of the parameter, set the data type, and the allowable values.
For the “input an integer number parameter example”, the window should look like this;


Note that the “Current value” can be anything as it will be changeable by the end-users later.
The Allowable values: All here is the part that allows this number to be changeable.

For the “create a list of columns” parameter, the window should appear as follow;

Note that instead of using “Allowable values: All”, this time “List” is used instead. And in the list, type in the column name in the value box and click enter to enter the next column name. Make sure they exactly match the column names in the data source!

 

2.) Show the parameter.

All the parameters created can be found on the bottom left of the data pane. Right-click on the parameter name and select “show parameter” as displayed in the image below.

These parameters can be seen on the right side of the tableau window, under “show me”

 

3.) Create a calculated field or a reference line.

Now the parameters can be utilised in our functions! To do so, create the calculated field on the data pane.

Use CASE function as displayed below.

Note that ‘Profit’ etc, were typed in manually, whereas the [Profit] etc, are the actual table columns. The logic reads as; When Axis Parameter is selected as, for example, ‘Profit’, show the data from [Profit] column.

 

Now the chart can be produced!
Drag the “Axis Parameter Field” to the rows shelf. Drag another continuous field into the columns shelf. Then drag the discrete data of interest into the detail section in the mark card. For instance, using Sample superstore data, I have entered Quantity in the columns shelf, my Axis Parameter in the rows shelf, and “Product Name” in the detail section and produced the chart below.

The axis title can be changed by right-clicking the “Axis Parameter Field” Axis, Edit Axis, change the title name into “Axis Parameter”.

As for the threshold parameter, instead of creating a calculated field, a reference line can be created using this threshold value. To do so, go to the analytics pane, drag the reference line into the chart.

In the “Value section”, Select the Input Number parameter that was created.

And this is the end product!

 

 

 

 

 

Note that as I changed the value in the Input number to 4000, the reference line shifted up as well.

The use of the parameter function is not exhaustive to what is shown in this blog. By understanding what a parameter is and what it can do, the possibilities of what can be created in Tableau are only limited to your creativity! Hope this helps and happy vizzing!

The Data School
Author: The Data School