Skip to main content

Life Hack by Comparative analysis in Tableau

What to do when there are 10 indicators and all of them should be analysed in dynamics and we need to avoid the scenario when dashboard is overloaded with a huge flow of information? Build 10 graphs with trend lines for each of the metrics? Hmm, it's cumbersome. Maybe, show all metrics on the same chart? I guess no because what if some indicators measured in percent, while others are measured in absolute equivalent?

One of the life hack which I often use in my job is creation of two sets of parameters.

Example

There are  three metrics each of them has two bars: dark and light blue bars. Dark blue bar indicates the value of metric as of 31 of March and  Light blue as of 13 of August. Dotted line indicates Benchmark (target value).
Pluses of approach:
  • We can manage which periods to compare up to days 
  • All metrics are automatically recalculated depending on the values of the selected periods
  • Easy to understand format of visualisation


How to make Comparative analysis in Tableau?

Step 1
Create set of parameter
  • Period 1 (Year)
  • Period 1 (Month)
  • Period 1 (Day)
 Example of Period 1 (Month). The same approach is for Year and Day parameters.
Step 2
Duplicate these parameters and rename it as 
  • Period 2 (Year)
  • Period 2 (Month)
  • Period 2 (Day)
Step 3
Create the following calculated fields:
 FY Year String = STR(DATEPART('year',DATEADD('month',-3,[Create Date]))+1)
 FY Month String = STR(DATEPART('month',DATEADD('month',-3,[Create Date])))
 FY Day String = STR(DATEPART('day',DATEADD('month',-3,[Create Date])))

Pay attention: The timeline is not tied for a calendar year, but for a financial one. In the example you can see that Fiscal Year starts from the April. 

If you do not have to convert your time line in the fiscal year, you need to use  the following calculations:
Year String = STR(DATEPART('year',[Create Date]))
Month String = STR(DATEPART('month',[Create Date]))
Day String = STR(DATEPART('day',[Create Date]))

Step 4
Bind the parameters to the created calculations:

FY Year Selection 1 = IF [Period1 (Year)]=[FY Year String] then [Create Date] else null end
FY Month Selection 1 =IF [Period1 (Month)]=[FY Month String] then [Create Date] else null end
FY Day Selection 1 = IF [Period1 (Day)]=[FY Day String] and [Period1 (Month)] =[FY Month String] and [Period1 (Year)]=[FY Year String] then [Create Date] else null end

Bind the same set of parameters for Period 2 (Year), Period 2 (Month), Period 2 (Day):
FY Year Selection 2 = IF [Period2 (Year)]=[FY Year String] then [Create Date] else null end
FY Month Selection 2 =IF [Period2 (Month)]=[FY Month String] then [Create Date] else null end
FY Day Selection 2 = IF [Period2 (Day)]=[FY Day String] and [Period2 (Month)] =[FY Month String] and [Period2 (Year)]=[FY Year String] then [Create Date] else null end

Step 5

Create calculation 'Metric 1 Selection' to fix the value of metric on the data, which you select on the block of parameters selection 1
Metric 1 Selection = if [Create Date]=[FY Month Selection 1]  and [Create Date]=[FY Month Selection 1] and [Create Date]=[FY Day Selection 1] THEN [Value] ELSE 0 END

Create 'Metric 2 Selection' in a similar way to fix the value of metric on the data, which you select on the block of parameters selection 2.

Step 6
Drag measure values Metric 1 Selection and Metric 2 Selection in the columns shelf. Click on one of the measure values and select dual axis, and then synchronise axis. 

Step 7
Play with size of bar charts and drag measure names field into a colour mark, in order to divide Metric 1 Selection and Metric 2 Selection by colours.








Comments

  1. thanks for sharing this hack by Comparative analysis in Tableau. It is really very helpful. Tableau Rest API Connection

    ReplyDelete
  2. Dashboards are a proven system for businesses as it helps them to consume the big data clearly so as to make fact-based decisions. Business users need not rely on their mere gut instincts. Inetsoft.com

    ReplyDelete
  3. This is an affiliate web site, if you make a deposit with a on line casino we earn a fee. To make things even more difficult, access to many overseas on-line e-wallets are banned or severely restricted for South Koreans. Even some of the well-liked playing e-wallets, PayPal has a unique operation for Koreans that include some strict restrictions – like you are not allowed to transfer funds to non-Korean PayPal accounts. For occasion, players in South Korea who win something on the local lottery are subject to playing taxes of something between 22% and 30%. It’s a lot of money cash} to lose, which is clearly 온라인 카지노 frustrating for South Koreans.

    ReplyDelete
  4. For those who value factual reporting, Farmakopoioi delivers consistent updates across global events and business topics. The platform’s writing is structured, informative, and easy to follow.

    ReplyDelete
  5. In a world of game tips, SubiendoBlass stands apart by delivering reliable cheat codes and updates that are easy to follow, regularly refreshed, and focused on real player needs across popular mobile gaming communities worldwide.

    ReplyDelete
  6. When staying informed about emerging technologies, MyTechRent offers insightful articles that explain AI developments and digital trends effectively. The content supports awareness and understanding in a rapidly evolving tech space.

    ReplyDelete

Post a Comment