Knowledge Base

Using Parameters

Product(s): Tableau Desktop, Tableau Public
Version(s): 8.0, 7.0, 6.1, 6.0
Last Modified Date: 21 Mar 2013
Parameters are dynamic values that can replace constant values in calculations and can serve as filters. For example, you might have a calculated field that returns True if Sales are greater than $500,000, and otherwise returns False. Using a parameter, you can replace the constant value of $500,000 in the calculated field with a parameter than you can change dynamically using the Parameter control.

Create a parameter

Step 1

Open a new workbook and connect to Superstore.

Step 2

In the Measures pane, right-click the Sales field and select Create Parameter.

Step 3

In the Create Parameter dialog box do the following tasks:

  1. In the Name text box, type Sales Goal.
  2. Click Comment and type a comment about this parameter. Format the comment as appropriate.
  3. Under Properties, in the Data type list, select the appropriate data type.
  4. If Range is pre-selected as the Allowable Values setting, you need to define the Range of values before you set the Current value.
  5. Under Range of values, set the minimum as the number you are replacing with a parameter, set an appropriate maximum, and the increment by which you want ton change the value of the parameter.
  6. If the Current value text box did not automatically populate with the value you set in the Minimum text box, type the number.
  7. In the Display format list, select the format for the parameter.
  8. When finished, click OK.

Create a calculated field that uses a parameter

Step 1

Select Analysis > Create Calculated Field.

Step 2

In the Calculated Field dialog box, make the following selections to create this formula:

IF SUM([Sales]) <= 500000 THEN "FALSE" ELSE "TRUE" END

  1. In the Name text box, type Sales Results.
  2. Click the Formula text box.
  3. In the Functions list, double-click IF and SUM.
  4. In the Fields list, double-click Sales.
  5. Click outside the closing parenthesis, space, type <=, and space again.
  6. In the Parameters list, double-click Sales Goal.
  7. Add a space, and type THEN "FALSE" ELSE "TRUE" END

Step 3

When finished, click OK.

Showing a parameter control

After you create a parameter, it appears at the bottom of the Data window in the Parameters section. This section appears in a workbook after you create a parameter.

Step 1

Right-click the parameter in the Parameter pane of the Data window and select Show Parameter Control.

Step 2

Drag the slider to reset the parameter, or click the arrows to increase or decrease it in the increments you specified for Step size in the dialog box.

Parameter control

Alternate Search Terms: parameter, calc, calculation
Did this article resolve the issue?


Search Knowledge Base