Parameterizing variables in your query give your visualizations more flexibility by
allowing you to make dynamic selections that are reflected immediately in the visualization.
Though there are several ways to do this, the method presented in this topic is one
technique that works well.
The following example assumes that you have specified the 1010data query example in
Tableau (see Specify a 1010data query in Tableau) and have
created the color-coded map (see Create a basic visualization in Tableau).
Although this example modifies a previously saved query to parameterize variables
within it, the parameterizations could have been done when you originally specified
the 1010data query in Tableau.
In this example, you will create a parameter for the division specified in the
1010data query so that you can change the division from within the Tableau workspace
without the need to create a separate worksheet or write a separate query for each
To parameterize a variable in Tableau:
From the Tableau workspace, click
pane is displayed.
Follow steps 2
in Connect to 1010data from Tableau.
The Tableau Data Source page appears.
From the Tableau Data Source page, double-click New Custom
The Edit Custom SQL
In the Edit Custom SQL dialog, enter the following Macro
<tabu label="Tabulation on Store Master" breaks="divisiondesc">
<tcol source="divisiondesc" fun="cnt" name="count" label="Count"/>
When this query is run, it will connect to the Store
Master table and tabulate all the possible values in the
column containing the division descriptions
A Processing Request dialog appears while Tableau is
loading the metadata.
When the processing is complete, the Tableau Data Source page is updated
to show the Custom_SQL_Query
Click the title of the data source and enter "Division
Codes" as the new title.
This will help you to easily identify the data source in the following
Click the arrow to the left of the title and select Custom_SQL_Query
The original data source is displayed.
Hover your mouse over Custom_SQL_Query and click the
Edit icon ().
The Edit Custom SQL
In order to parameterize the variable associated with the division description,
highlight the value of the variable in the 1010data query.
The Create Parameter
Modify the values in the Create Parameter dialog.
In the Name field, enter
Select String from the Data
Type drop-down list.
Click the List radio button.
The List of values
This populates the List of values
the values returned from the tabulation in the Division
Click OK in the Create
The value of divisiondesc
is replaced with the
Click OK in the Edit Custom SQL
From the Tableau workspace, click Sheet 1 to go back to
the original visualization.
In the Parameters section on the
Data tab, click the drop-down arrow for the
Division parameter and select Show
parameter control is added to the
Click the drop-down arrow on the Division parameter
control and select Single Value List.
parameter control shows all possible
values for the division description.
From the list of values in the Division parameter
control, select North.
The map dynamically updates to show those states in the North division
that have sales. The states are filled in according to the color gradient to
reflect the magnitude of the sales totals.
Congratulations! You now have a truly interactive visualization that allows you to
select specific geographic areas, created using 1010data analytics and Tableau