Create Parameters

Parameters are dynamic values that can replace constant values in calculations, filters, and reference lines.

For example, you may create a calculated field that returns true if Sales are greater than $500,000 and otherwise return false. You can replace the constant value of “500000” in the formula with a parameter. Then using the parameter control you can dynamically change the threshold in your calculation. Alternatively, you may have a filter to show the top 10 products by profit. You can replace the fixed value “10” in the filter to by a dynamic parameter so you can quickly look at the top 15, 20, and 30 products.

You can make your parameters more dynamic and interactive by using them in Parameter Actions. Parameter actions let your audience change a parameter value through direct interaction with a viz, such as clicking or selecting a mark.

Watch a video: To see related concepts demonstrated in Tableau, watch the free training video Parameters (5 minutes). Use your tableau.com account to sign in. For a more in-depth presentation, see Parameters | Oh, the places you'll go! (45 minutes).

Learn more: See Use Parameters to Add Multiple Views to Your Viz on the Tableau blog and multiple practical topics on how to use parameters on the Data School website, such as Four Steps to Creating a Parameter.

Create a parameter

Follow the instructions below to create a new parameter from the Data pane.

  1. In the Data pane, click the drop-down arrow in the upper right corner and select Create Parameter.

  2. In the Create Parameter dialog box, give the field a Name.

    In Tableau Desktop, you can optionally write a Comment to describe the parameter.

  3. Specify the data type for the values it will accept:

     

  4. Specify a current value. This is the default value for the parameter.

  5. Specify the display format to use in the parameter control (Tableau Desktop only).

  6. Specify how the parameter will accept values. You can select from the following options:

    • All - the parameter control is a simple type in field.

    • List - the parameter control provides a list of possible values for you to select from.

    • Range - the parameter control lets you select values within a specified range.

    The availability of these options is determined by the data type. For example, a string parameter can only accept all values or a list. It does not support a range.

    If you select List, you must specify the list of values. Click in the left column to type a value. Each value can also have a display alias. You can copy and paste a list of values by clicking Paste from Clipboard. Alternatively you can add the members of a field as the list of values by selecting Add from Field.

    If you select Range you must specify a minimum, maximum and step size. For example, you can define a date range between January 1, 2010 and December 31, 2010, with the step size set to 1 month to create a parameter control that lets you select each month in 2010.

  7. When finished, click OK.

    The parameter is listed in the Parameters section at the bottom of the Data pane.

    It is also available everywhere else you can use a parameter – for example, on the Top tab in the Filter dialog box, or in the Reference Line dialog box. Parameters are global across the workbook and can be used in any worksheet.

Edit a parameter

You can edit parameters from the Data pane or the parameter control. Follow the instructions below to edit a parameter:

  1. Do one of the following:

    • Right-click (Control-click on a Mac) the parameter in the Data pane and select Edit.

    • Select Edit Parameter on the parameter control card menu.

  2. In the Edit Parameter dialog box, make the modifications as necessary.

  3. When finished, click OK. The parameter is updated along with any calculations that use it.

To delete a parameter, right-click it in the Data pane and select Delete. Any calculated fields that use the deleted parameter will become invalid.

Use a parameter in a calculation

Parameters give you a way to dynamically modify values in a calculation. Rather than manually editing the calculation (and all dependent calculations), you can use a parameter. Then when you want to change the value, you open the parameter control, change the value, and all of the calculations that use that parameter are updated.

To use a parameter in a calculation, drag the parameter from the Data pane and drop it in the calculation editor, either at a new location in the formula or to replace a part of the current formula:

Use a parameter in a filter

Parameters give you a way to dynamically modify values in a Top N filters. Rather than manually setting the number of values you want to show in the filter, you can use a parameter. Then when you want to change the value, you open the parameter control and the filter updates. For example, when creating a filter to show the Top 10 products based on total profit, you may want to use a parameter instead of the fixed “10” value. That way, you can quickly update the filter to show the top 10, 20, or 30 products.

A list of parameters is available in the drop-down lists on the Top tab of the Filter dialog box. Select the parameter you want to use in the filter.

To show the parameter control, right-click the parameter in the Data pane and select Show Parameter Control. Use the parameter control to modify the filter to show the top 10 products, 15 products, 20 products, and so on.

Use a parameter in a reference line

Parameters give you a way to dynamically modify a reference line, band, or box. For example instead of showing a reference line at a fixed location on the axis, you can reference a parameter. Then you can use the parameter control to move the reference line.

A list of parameters is available in the Value drop-down list in the Add Reference Line, Band, or Box dialog box. Select the parameter you want to use.

The reference line is drawn at the Current Value specified by the parameter. To open the parameter control, right-click (Control-click on a Mac) the parameter in the Data pane and then select Show Parameter Control. Use the parameter control to change where the reference line is drawn.

Show a parameter control in the viz

The parameter control is a worksheet card that lets you modify the parameter value. Parameter controls are very similar to filter cards in that they contain controls that modify the view. You can open parameter controls on worksheets and dashboards and they are included when you save to the web or publish to Tableau Server.

To open the parameter control, right-click (Control-click) the parameter in the Data pane and select Show Parameter Control.

Like other cards, parameter controls have a menu that you can open using the drop-down arrow in the upper right corner of the card. Use this menu to customise the display of the control. For example, you can show a list of values as radio buttons, a compact list, a slider, or a type in field. The options available on this menu depend on the data type of the parameter as well as whether it accepts all, a list, or a range of values

Thanks for your feedback! There was an error submitting your feedback. Try again or send us a message.