For context, we were recently challenged with visualising data from a chosen API. I was interested in mapping collections of top dessert places in Sydney from Zomato and wanted to give the user the ability to flip through different views depending on their needs. We had just learnt about parameters, and thought that using parameter selections might be a neat way to achieve this.
Parameters in Tableau allow you to control and replace constants, such as in filters or calculations. The viewer can then directly interact with your viz to alter these parameter values for themselves.
For my visualisation, I decided to go with three options: sorting by restaurant collection, price range, and user ratings.
1. Create a parameter
Create a new parameter that lists your dimensions of interest. In this example, I went with an integer list of values for simplicity. However, if string labels make more sense for you, simply replace the data type and values. The ‘display as’ values will be what your user interacts with, so make sure you choose something that makes sense. For example, a list of short instructions works well.
Make sure the parameter control card is displayed.
2. Create a calculated field
The next step is to create a calculated field that will be used as a dimension in your worksheet. This instructs Tableau which dimension to display when a particular parameter value is selected.
3. Add the calculated field to the canvas
To colour the restaurants by the different dimensions, I simply had to drag the calculated field to colour and ensure it was being used as a dimension. Note it is still possible to choose a different colour scheme for each dimension. You can also drag the calculated field to the filters card to let the user filter within each dimension. So in my example, I gave users the ability to select specific collections, price ranges, or user ratings.
It’s as simple as that!
Of course, this is just skimming the surface of what parameters can do in Tableau. For more information and examples of how to take advantage of them, check out these Tableau articles on creating parameters and parameter actions.