Using Parameters in Tableau Visualizations (Part 1)

Using Parameters in Tableau Free Tutorial

Gain an understanding of parameters in Tableau, how to create them, and their various applications in data visualizations. Explore how parameters can be used in calculations, filters, and reference lines to replace constant values, thereby providing dynamic control of visualizations.

Key Insights

  • Parameters in Tableau are dynamic values used to replace constant values in calculations, filters, and reference lines, providing dynamic control of visualizations.
  • A parameter is created in the data pane under 'Dimensions'. It requires setting a Name, Data type, and default value (Current value).
  • Parameters can be formatted as 'All' for a type-in field, 'List' for a list of values to choose from, or 'Range' for presenting values within a range.
  • Parameters are included in calculated fields or filters by replacing the constant value with the parameter. This allows for dynamic changing of the threshold in calculations.
  • Parameters can also be used in reference lines, bands, or boxes to modify them dynamically. The reference line is drawn at the Current Value specified by the parameter, and editing the parameter value updates the position of the reference line.
  • Parameter actions allow users to change a parameter value through direct interaction with the dashboard, like clicking or selecting a mark. These can be used with reference lines, calculations, filters, and SQL queries to customize data display in visualizations.

Tableau Parameter Basics

  • Dynamic Values

    Replace constant values in calculations, filters, and reference lines with user-controlled parameters.

  • Allowable Values

    All (type-in field), List (dropdown), or Range (min/max with step size).

  • Create from Field

    List parameters can pull values directly from an existing field.

  • Used in Calculations

    Drag the parameter into a calculated field formula to make the calc dynamic.

What Are Parameters?

Parameters are dynamic values you set to replace constant values in calculations, filters, and reference lines. In your data pane, your first step is to create a parameter by clicking the arrow next to Dimensions and selecting Create Parameter from the menu. Tableau Create Parameter dialog box with name, data type, and allowable values This opens the parameter pop-up window where you select your options for the parameter: Set the Name, Data type, and default value (Current value) for the parameter.

Tableau parameter configuration and usage - step 2 Note: The Display format option is only available in Tableau Desktop.

The Allowable value, determined by the data type, can be either All, List, orRange, and these options format your Parameter Control as follow:

  • All—the parameter control is a simple type-in field
  • List—the parameter control provides a list of values to choose from
  • Or Range—the parameter control presents values within a range

For List, you must specify the list of values, which you can add from a field using the option Add from Field.

Tableau Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

Tableau parameter control widget displayed on the worksheet

For Range, you must specify the Range of Values (minimum, maximum, and step size) within that range. You can also use the values from a field. Tableau parameter configuration and usage - step 4 Once you create a parameter, it will appear within a new panel at the bottom of the data pane.

Tableau parameter configuration and usage - step 5

How to Use Parameters

Parameters can not change your visualization unless they are incorporated into a calculation or a filter. Usually, you replace the constant value with the parameter in a calculation, then use the parameter control to dynamically change the threshold in your calculation.

In the example below, we used a parameter “sales-parameter” within a calculated field, then display it in the visualization.

Tableau parameter control widget displayed on the worksheet

Using Your Parameter in a Calculation

Open your calculated field using right-click > edit calculated field. Drag the parameter to your formula to replace the constant or part of your formula. Edit the values of your parameter; it will automatically update your formula. Tableau calculated field editor using parameter in the formula logic

Tableau calculated field editor using parameter in the formula logic

Using Your Parameter in a Filter

Tableau filter action connected to parameter for interactive data filtering

In the above example, we created a parameter to filter by State and display the sales for the selected state in the search state type-in field. We dynamically control the values used in a filter Contains state.

First, create your parameter as below. Then, show the parameter control, right-click the parameter in the Data pane, and select Show Parameter Control.

Tableau parameter control widget displayed on the worksheet

You create your calculated field in which you control the values using the parameter.

Tableau parameter control widget displayed on the worksheet

Then drag the calculated field to the filter panel and set the filter.

Tableau parameter control widget displayed on the worksheet

Using Reference Lines with Parameters

You can use a parameter to dynamically modify a reference line, band, or box. Then use the parameter control to display the reference line at various values point for your parameter. The reference line is drawn at the Current Value specified by the parameter, editing your parameter value will update the position of the reference line.

Parameter Control

You can customize the parameter control and include it in any sheet or dashboard you create. The Parameter control presents similar features to the filter controls.

Click on the menu of the parameter to display it.

Tableau parameter control widget displayed on the worksheet

You will be able to display your control values as radio buttons, a compact list, a slider, or a type-in field. The available options will depend both on the data type, and whether you have selected all, list, or range in your parameter settings.

Tableau parameter configuration showing data type and allowable values settings Note: Parameters are set globally and can be used in any of your worksheets. They are also available in the “top” tab in the filter pop-up window.

Tableau filter action connected to parameter for interactive data filtering

Any edit to the parameter will update any formula or filter that uses it.

Going Further: Using Parameter Actions

In a future article, we’ll explore actions using parameters. You will see that you can control your parameter values using parameter actions, letting your users change a parameter value through direct interaction with your dashboard. This, for example such as clicking or selecting a mark. You’ll be able to use parameter actions with reference lines, calculations, filters, and SQL queries, and to customize how you display data in your visualizations.

Topics

Learn more in these courses

How to Learn Tableau

Master Tableau with Hands-on Training. One of the World’s Most Popular Data Visualization Tools, Tableau Allows Users to Create Graphs, Charts, and Other Illustrations to Share Their Analytical Findings.

Yelp Facebook LinkedIn YouTube Twitter Instagram