What If Analysis Scenario in Tableau


Parameters are one of the most powerful features available in Tableau to analyze and interact with data. Parameters are dynamic values that can replace constant values in calculations. For example, you may create a calculated field that returns true if Sales is greater than $500,000 and otherwise return false. You can replace the constant value of “500,000” in the formula with a parameter that you can change dynamically using the parameter control.

In this post we will use parameters feature to create a “What-if” analysis. A “What-if” analysis is the process of changing the values a parameter to see how those changes will affect the outcome of data in a Tableau worksheet.

Let’s use superstore data that comes with Tableau desktop. We will analyze Gross Profit % (GP%) from the data set and build a KPI that would help us in identifying months that have exceeded the Profit Target set by a parameter.

  • Create a calculated field with GP% = sum([Profit])/sum([Sales])
  • Filter out the data for 2013 year in “Filters” pane. Also, setup a quick filter with single value list
  • Create a view like below with order date in row shelf and GP% in column shelf

 

Tableau Bi

  •  To create a parameter, right click in the Parameters window in the bottom left corner of the sheet view and select “Create Parameter”. You will have six data type options to choose from. We will select float data type as GP% is best represented in decimals. Name the parameter as GP Target. Let’s keep the current value as 0 (which will be default value when you use parameter for the first time). Choose display format as “percentage” with one decimal point. Giving a “range” would specify the lower and upper limit of the parameter. Here we will take it as 0 and 1, where 1 being highest (100%) and 0 being the lowest (0%) with increment of 5% (0.05 step size).

Tableau-what-if-analysis

  •  A parameter is a dependent variable which means it does not do anything on its own. There has to be a condition defined that would allow us to use the parameter. In this what-if analysis we want to see whether GP% was achieved in a particular month or not. So, we will create a calculated field that would satisfy the condition if the GP% is greater or equal to GP Target

Tableau

  • Drag the calculated field “Profit KPI” from the above step and drop it in color shelf of marks card

Tableau-What-if

  • Last step is to right click on the parameter “GP Target” and select “show parameter control”
    Your first what-if analysis is ready! As you move the “GP Target” slider, you will have the months highlighted (in blue or red) if they have achieved the profit target or not.

What-if-in-Tableau

For more information related to Tableau, kindly email us on sales@bistasolutions.com.

Share this blog:
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

4 Comments on "What If Analysis Scenario in Tableau"

Notify of
avatar

Sort by:   newest | oldest | most voted
Lukman ITN MALANG
Guest
4 years 8 days ago

I am regular reader, how are you everybody? This piece of writing posted at this web site is in fact fastidious.|

Owen
Guest
Owen
3 years 11 months ago

This is my first time visit at here and i am genuinely happy to read everthing at one place.|

jasa
Guest
jasa
3 years 11 months ago

Hi there, You’ve done a fantastic job. I’ll certainly digg it and in my view recommend to my friends. I’m sure they’ll be benefited from this website.|

fifa 17
Guest
fifa 17
3 years 3 months ago

I love this site – its so usefull and helpfull

wpDiscuz

Contact Us

Related Categories

Recent Posts

SUBSCRIBE TO OUR BLOG
Email *