Do you use parameters – I love them and use them a lot – Let's look at them in more detail
Parameters are one-way users can directly input a value into Tableau.
- Single valued – have one value at a time
- Static the value is constant until manually changed by the user
- Global – they are available for use throughout the workbook.
But they don’t do anything until they are used in a calculation, a set, or a filter.
The same parameter can be used in any mix of calculations or filters on a single or any combination of worksheets or dashboards. Changing the value of the parameter will change the calculation or filter wherever it is used. The change takes place as the sheet is opened.
There are 3 steps to follow when using parameter
- Create it
- Put it in the viz
- Use it in a calculation or filter
Select Create Parameter – when the window opens set up the parameter
- Add a meaningful name that tells the user what to do
- Select a data type that matches that of the dimension you will use
- Load values into the parameter either typing directly or from the dimension
- Click OK and you are done
2 Add the parameter to the viz
All you need to do is open the parameter pill and select Show Parameter Control
3-Use it in a calculation or a filter
After creating the parameter you need to use it – it is the calculation or the filter that affects the data in the viz – not the parameter by itself.
Example 1 – Parameter driven T/F filter
The easiest way to use the parameter is in a True/False filter – the expression just says when the subcategory is equal to the one the user selected using the parameter return a True
Example 2 – Use it in a Set
Example 3 – Change all views in a dashboard
Example 4 Top N filtering
When the window opens – select a starting value and a range
The user can set the N from the control on the left – Note also the subcategory dropdown will list all subcategories and has a reference to the Top N filter application
Example 5 – Parameter Actions
With the 2019.2 release Parameter Actions were introduced given the user an easy visual way to change parameter values for the viz without opening a dropdown –
I will replace the parameter drop down from the earlier example with a value picker – a simple worksheet with the values (here subcategory names and a circle mark) A horizontal will work well the overall layout of the dashboard
- From the Dashboard on the upper ribbon select Action
- Then Add – Change Parameter
- Give the action a name
- The source is – Value Picker
- The target is 'Select Subcategory' parameter
The dynamic parameter setup adds only a couple of fields to the one you have used so far
- the parameter that is to be updated and the field in the data set
- initial value of the parameter (default is Current)
In the example I added a LOD for the fixed max date in the data set – the parameter value will update to the latest date in the data set