This article will show how to Create Tableau Parameters with an example. They play a significant role in creating Dynamic reports. For instance, While creating Filters, we can replace the Constant value with this value. It means the Tableau parameters allow the user to dynamically set the Filter values per their requirement.
Apart from that, while creating Calculated Fields (or Calculations), we can replace the constant value with this value. Tableau Parameters allow the user to change the values. Remember, You can create a New one rather than edit the old one.
How to Create Parameters in Tableau?
There are multiple ways to create Parameters in Tableau. This example shows how to create them, their types, and use them as Filters.
First, Drag and Drop the Product Name from Dimension Region to Rows Shelf and Sales Amount Measures region to Columns Shelf. By default, Tableau will generate the Bar Chart. Please remember, We have 130 Rows in our Report.
First Approach to Creating Parameters in Tableau
Please click on the Drop down arrow in the upper right corner of a Dimensions region and select the Create option.
The second method to create these Tableau Parameters is, Within the Data pane, Right Click on the Empty space to open the context menu. Please select the below-shown option from it
Once you choose the option, a new window will open. Within the Name section, specify a Unique name for the Tableau Parameters, and provide a valid comment by clicking the comment button.
Please select the valid Data Type name from the Dropdown menu. For instance, if you choose a String data type from the list, the param can only accept string data. For this demo, we are selecting Integer Data Type
The Display Format option of the Tableau Parameters allows you to format the value. For example, if you want the Select Top N Product param to show the range between 10 percent to 80 percent, you can use the Percentage; otherwise, select Automatic.
We have three options in Allowable values. In this example, we show you three possibilities with an example. First, we are selecting the All option as Allowable values.
Next, we added filter conditions on the Product Name. To do this, Please drag and drop the Product Name from Dimension Region to Filters Shelf. Once you complete it, a new window will open to write the condition.
For this Tableau Parameters example, we selected Top N products by the Sum of Sales Amount. And instead of writing a constant number 10, we added the value.
In some versions, Tableau parameters control may display automatically. If this is not the case, please click on the Dropdown arrow in the upper right corner of a param name and select the below-marked option.
Once we complete it, you can see the control. Our report will default display Top 10 records because we specified the Current value as 10 while creating it.
Let us change the Parameter number to Top 100. Notice that our report displays the Top 100 product names based on the number.
Tableau Range Parameters
Let us see what will happen when we change the Allowable values from All to Range. To edit the existing one, click on the Drop down arrow in the upper right corner of the param name and select the Edit.. option.
Let us change the Allowable values of Tableau parameters from All to Range and add the Minimum and Maximum numbers.
- Minimum: Please specify the Minimum Range number. For now, we are adding 2 as the minimum number.
- Maximum: Specify the Maximum Range number. Our report has 130 records, so we are adding 130 as a maximum number.
- Step Size: Scale step size. For now, we are adding 5 as the Step Size because we have only 130 records. If your records are more, please feel free to change this number to 50, 100, or a thousand.
Please change the display option from Type Into Slider. To do this, select the Dropdown arrow in the upper right corner of the newly created Tableau Parameters name and select the Slider option.
Once completed, use the Parameters Slider to filter the Data based on the param number.
Tableau List Parameters
Let us change the Allowable values from range to List and add the List of numbers. For now, we are adding 4 numbers to the list.
- Value: This is the number used to filter the data. For example, if we set the number as 10, the report will display the Top 10 records.
- Display As: This will be a label name. It would help if you used the more meaningful full name here
By default, Parameters will display the number as 10 and label it as Top 10. Notice that our report displays the Top 10 product names.
Let us change the number to the Top 100. Notice that the Tableau Parameters report shows the Top 100 product names.