With the recent release of the new Tableau, there has been a lot of buzz around the new parameter action features. Therefore, I thought I would take a step back and write a blog post about how to actually create a good old parameter in the first place!
Coach Carl provided us with 4 simple steps early on in our Tableau journey, so let me explain these to you.
Step 1 – Create the Parameter
Ok… so this step seems a bit odd as isn’t this what the whole blog is about? But actually creating the parameter in Tableau is only the first step. Therefore, go ahead and right click on the data pane and press ‘Create Parameter’.
This brings up a dialog box which will allow you to have various different options to choose a data type:
Here are what all of these options mean:
- Float – Any Number including Decimals.
- Integer – Any Whole Number
- String – Text
- Boolean – True or False
- Date – Date without a Timestamp
- Date & Time – Date with a Timestamp
You also have the opportunity to choose from All, List or Range (depending on what option you have chosen). These are all pretty self explanatory… ‘All’ means all values can be chosen, ‘List’ is only values that you have provided in the list below, and ‘Range’ is only values within the given range that you set.
For the rest of this example I’ll create the parameter below, which will later allow us to highlight a specific sub-category from our list.
Step 2 – Show the Parameter Control
Now this again seems like a simple step, but it’s an important one to make sure the interactivity is available for the user. Therefore, if you right click on the newly created parameter and choose ‘Show Parameter Control’ then the parameter will appear on screen.
Step 3 – Create Calculated Field
The next step allows the parameter to come to life within the view. We need to create a calculated field so that the parameter can interact with the data. There are many use cases for this, however in this case we are going to highlight a specific sub-category.
This is a simple calculation and is just:
[Sub-Category]=[Choose Sub-Category]
Step 4 – Use the calculation in the view
The final step is where this all comes together and the parameter starts to work. As a simple visualisation we can build a bar chart, showing the total sales of each sub-category, just like below:
Next, bring the created field onto the colour marks card and one of the bars should change colour. This different coloured bar, should be the same as whatever sub-category is chosen in your parameter. By selecting a different sub-category then the coloured bar should update each time.
That’s it! You’ve created a simple parameter.