Parameters in tableau, when used correctly, will allow users to dynamically change the threshold of a parameter based on their needs.
According to Merriam-Webster, a parameter is defined as a limit or boundary.
In tableau, a parameter is a constant which determines how many options we have to choose from, or a certain range in which we can choose from.
Lets create in interactive viz where the user can adjust parameters to suit their needs.
We are going to start with a scatter plot showing sales vs. profit.
Create a Parameter
Firstly, we are going to create a parameter by:
- Right clicking on the sales pill -> Create -> Parameter
After that, set a meaningful name for the Parameter, then in the range of values click set values from and select sales, click OK.
- Similarly for profit, we will repeat step 1 for the profit pill, but in the range of values select profit.
- Right click on the new sales parameter, and click show parameter. Right click on the new profit parameter, and click show parameter.
Create Reference Lines
Second, we will create the reference lines:
- Go to the analytics pane and drag the reference line onto the sales under table.
- In the dialogue pop-up, change the value to the name of your sales parameter.
- Click OK.
- Repeat the same for profit.
Color Code Results
Finally, we will add a color coding system to our viz to identify the orders that satisfy both of our parameter conditions.
- Create a calculated field by clicking on the down arrow in the top right of the data pane and selecting “Create Calculated Field…”
- Next, we will enter a formula to isolate the orders that satisfy both parameter conditions.
- Finally, we need to drag the newly created calculated field to the marks card and drop it on colour.
The Final result will look like this.
We have now successfully created a viz where the user can adjust the sales and profit thresholds according to their specific needs.
Using Sample Superstore data, try and create dynamic reference lines using different dimensions and measures.
credit to freepik for the image.