2 Replies Latest reply on Sep 28, 2017 4:40 PM by Shinichiro Murakami

# Calculation Field: Variance for each Quarter

Hello.

Would like to know how to do a calculated field in Tableau for variance between years/quarters for Measure Values.

Results should show the difference in sales/profit in a new column (on the right) along with % variance.

In short, would like to have 2 different columns, with one showing the difference in sales/profit and another in %.

• ###### 1. Re: Calculation Field: Variance for each Quarter

Hi Gwyn,

Find my approach as reference below and stored in attached workbook version 10.1 located in the original thread

e.g. Profit

1. 2012 K1 Profit: if year([Order Date])=2012 and [Order Date (Quarters)]=1 then [Profit] END

2. 2012 K2 Profit: if year([Order Date])=2012 and [Order Date (Quarters)]=2 then [Profit] END

3. 2013 K1 Profit: if year([Order Date])=2013 and [Order Date (Quarters)]=1 then [Profit] END

4. 2013 K2 Profit: if year([Order Date])=2013 and [Order Date (Quarters)]=2 then [Profit] END

5. delta Profit K1: sum([2013 K1 Profit ])-sum([2012 K1 Profit])

6. delta Profit K2: sum([2013 K2 Profit ])-sum([2012 K2 Profit])

7. delta Profit K1 %: (sum([2013 K1 Profit ])-sum([2012 K1 Profit]))/sum([2012 K1 Profit])

7. delta Profit K2 %: (sum([2013 K2 Profit ])-sum([2012 K2 Profit]))/sum([2012 K2 Profit])

Regards,

Norbert

• ###### 2. Re: Calculation Field: Variance for each Quarter

Hi Gwyn

Another approach with duplicating data source.

Thanks,

Shin

<< Ambassador Spotlight Here ! >>