How to Create and Use Parameters in Tableau?

Upasana Priyadarshiny
Edureka
Published in
5 min readMay 30, 2019

Think about it like this, what if you need a component for your visualization that is not exactly in your dataset. Parameters in Tableau will allow you to provide that value to pass into.

This article covers the following topics:

  • What are the Parameters in Tableau?
  • Getting Started
  • Creating Parameters in Tableau
  • Using the Tableau Parameters in Calculations
  • Parameter Control
  • Using Tableau Parameters in your Visualization

What are the Parameters in Tableau?

Parameters in Tableau allow you to use aggregated values that aren’t available in your data and incorporate these values into your dashboard reports. After creation, end users can control the input to see the results of the effect of the parameter.

So, what exactly is a Parameter in Tableau?

Any value passed to a program in order to customize the program for a particular purpose is called a Parameter. It could be anything: A string of text, a range of values, or an amount just to name a few.

Parameters help you experiment with some what-if scenarios. Suppose you are unsure which fields to include in your view or which layout would work best for your viewers. You can incorporate parameters into your view, to let viewers choose how they want to look at the data.

When you use parameters, you need to tie them to the view in some way:

  • In calculations and calculated fields that are used in the view.
  • To display the parameter control in the view for users to select parameters.
  • To reference parameters in parameter actions.

Just theoretically knowing about this concept wouldn’t do you any good. So, in the next few segments, I shall guide you through the process of creating and using Parameters in Tableau.

Step 1: Getting Started

You can start out by opening Tableau and connecting to the Superstore Sample DataSet.

1. Drag Order Date to the Columns Shelf and Sales to the Rows Shelf.

2. Right-Click the Year Pill on the Column Shelf.

4. When the Custom Date dialogue box appears, click on the Month/Year option from the dropdown menu.

You shall end up with a graph along the lines of the following:

Step 2: Creating Parameters in Tableau

So, the scenario I’m trying to create is a what-if scenario. For example. what if Sales were 3% more.

To create a parameter, do the following;

  1. Go to Analysis Menu and select Create Calculated Field. Alternatively, you could right-click within the Measures pane and select Create Calculated Field from there as well.
  2. Now, before creating the calculated field that is going to use our parameter, we have to create the parameter. So on the lower half of the window, there is a section titled Parameter and a link next to it that says Create. Click on Create.
  3. Fill in the fields exactly as shown.
  4. Click on OK. Your Parameter now shows up in the Parameter box.

Step 3: Using the Tableau Parameters in Calculations

Now, for this scenario, we now want to use our parameter and some to create a calculated field to add to our graph to see its effect on our data. While still in the Calculated Field dialogue window, create your calculated field:

1. Name your Calculated Field IF_Sales(Calc)

2. Formula: [Sales] * (([IF_Sales Param]/100)+1)

3. Click on OK.

Notice that in the calculation the parameter we created is going to interact with the Sales Measure.

Step 4: Parameter Control

Coming back to the Tableau main view, you will see your Calculated field in the Measures pane, and the parameter in the Parameters pane of your Data Window.
1. Click on the Parameter IF_Sales Param

2. Select Show Parameter Control

3. At the top right of your view, your Parameter Control Filter will be displayed.

Step 5: Using Tableau Parameters in your Visualization

1. Drag the Calculated Field IF_Sales(Calc) and drop it on top of your Sales Axis. As you hover over it, you will notice a transparent equal sign.

2. After dropping you will notice Measure Names has now been added to your Colour Shelf, and a Colour Legend is showing both Sales and IF_Sales.

3. Because your Parameter control is at 0, your lines are on top of each other.

4. Click on your Parameter control, and you will see the two lines appear.

These lines represent the running values of Sales from your dataset and your Calculated Sales simultaneously. And you’ve successfully incorporated your parameter in your visualization!

Parameters are dynamic and useful elements for you to add interactivity and flexibility to a report. It is a versatile tool and can be used in calculations and sets, equally well!

If you wish to check out more articles on the market’s most trending technologies like Artificial Intelligence, DevOps, Ethical Hacking, then you can refer to Edureka’s official site.

Do look out for other articles in this series which will explain the various other aspects of Tableau.

1.Tableau Tutorial

2.What is Tableau?

3. Tableau Functions

4. Tableau Dashboard

5. LOD Expressions in Tableau

6. Tableau Tips and Tricks

7.Step By Step Guide To Learn Tableau Public

8. Tableau Desktop vs Tableau Public vs Tableau Reader

9. Tableau Charts

10. What are Sets in Tableau And How To Create Them

11. Data-blending

12 . Donut Charts in Tableau

13.Top 50 Tableau Interview Questions You Must Prepare In 2020

14. How And When To Use Different Tableau Charts

Originally published at https://www.edureka.co on May 30, 2019.

--

--