Parameters are a very powerful instrument to use in Tableau because they enable the user to set the view the way he or she actually prefers.
I think parameters are a natural continuation for the series of blog posts about dashboard design:
- Some tips about Dashboard design
Because usability is another aspect which is so important in your dashboard and sometimes parameters can make things easier for you and your user.
How can they be used?
- Thresholds control: for example, reference lines
- What if analysis
- Dynamic dimensions, measures
- Titles, axis names
- Top N
- Swap between different sheets
- Other uses
How to use them practically?
- Create a parameter
- Create a calculated field connected to the parameter in order to activate it
Step 2 is not always compulsory: there may be no need to create a calculated field if we are doing a reference lines or a top n, for example.
- THRESHOLDS CONTROL
Imagine you have a line chart as in the picture below (x axis= day of order date and y axis= sales) and you want to do a dynamic reference line “Select a date” so that the user can set it as he/she wants.
- Just click on the analytics pane and drag “Reference line” on the chart and the table below would appear on the view. Place it on Table> Day(Order date) as below:
2. Click on the dropdown that would appear and select “Create a New Parameter”:
3. Name your parameter, choose a display format, set from field on your date (order date) and define a step size if you want as below, then click ok:
4. After clicking ok, select label>computation (or none if you want to show nothing) that would show the line value (so the date of the reference line), then format as you prefer the reference line (colour, dashed or continuous line).
- Do not set a step size but leave if you have a lot of days in your dataset: it would be hard and boring for the user to use it like this. Click on the top right corner of the parameter and select “type in”
2. Be mindful of the format of the parameter (see below):
When using continuous date, Tableau set up the parameter as default with hh:mm:ss BUT you can change this just right clicking on the parameter and selecting “Edit parameter” and changing the data type to “Date” (and not Date time).
This would be the result:
3. Add some context and make it easier to understand visually. I would also recommend to use a calculation to colour in different ways the line chart before and after the reference line date (threshold). The calculation is very simple. So, create a calculated field that says:
[Order Date]>=[Select a date]
Then drag this on colour. Below the view with this implemented. When the user will change the parameter, accordingly the colours will change.
I hope you found this useful!