Using Tableau Parameters to Switch Dimensions

Christina Butler, Assistant Director for Institutional Research and Evaluation, Tufts University

Institutional Research offices often receive requests to look at various statistics broken down by many different demographic categories (e.g., gender, race, and academic discipline, to name a few). In Tableau, this kind of break down can easily be done by setting up a parameter.

This Tech Tip assumes a basic working knowledge of Tableau. For additional help and resources for getting started in Tableau, visit the Tableau website. Note that files used for this example open in a .Zip file.

1. With your data source open in Tableau, navigate to Sheet 1 to begin creating a new worksheet. To follow along with the data source referenced in this example, use the Excel file.

You can also access the completed example in the below Tableau packaged workbook. To open it, use either your own copy of Tableau Desktop 10.0 (or later) or download Tableau Public (for free) and then access the Tableau file for this example.

2. Drag the dimensions and measures you would like to view onto the workspace of Sheet 1. For this example, we’ll look at full time and part time student enrollment split by several different dimensions and use a parameter to switch between these dimensions. Using the sample data set, drag the “Full Time or Part Time” dimension onto the Columns shelf and drag the “Number of Records” measure onto the Label icon in the Marks card.tableau1.JPG

3. Click on the drop-down arrow in the upper right hand corner of the Click on the drop-down arrow in the upper right hand corner of the Data pane and select Create Parameter...

4. Do the following in the Create Parameter window:

a. Choose a descriptive name for your parameter

b. Select String as the Data type

c. Select List as the Allowable values


5. Next, start listing the various demographic categories you plan to use in your visualization in the List of values box. You need to type the list values directly into the Value column and the Display As column. The Value column contains the list of categories and the Display As column contains the exact text that the end user sees when selecting a demographic category. These two columns can contain the same values or you may choose to use shorter descriptions in the Value column and longer descriptions in the Display As column.

6. Once you finish creating your parameter, select OK.

7. Your newly created parameter now shows up at the bottom of the Data pane. If you right-click on your parameter and select Show Parameter Control, a drop-down menu appears in your visualization workspace.


8. As you can see, the drop-down menu in your parameter does not yet function properly. To make it work, create a calculated field. Right-click on your parameter in the Data pane and select Create --> Calculated Field.

9. The The Calculated Field uses a CASE statement for the list of values being used in your parameter. The CASE statement returns the Dimension that matches the value selected in your parameter. Below is an example of a calculated field using the values from above:


10. Once you have finished creating your calculated field, locate it in your list of Dimensions and drag it on to the Rows shelf. The parameter drop-down menu should now function properly and switch between the different demographic categories. By selecting the drop-down arrow in the upper right corner of your parameter, you can customize the parameter in a number of different ways (e.g., change title, formatting and menu type).



To add a comment, Sign In
There are no comments.