5 Replies Latest reply on Nov 29, 2018 1:23 PM by Dietz Niesen

# Creating a difference on a measure across the dimensions of year and quarter

I have a table that has measures down the side and year/quarter across the top for 2 years. I would like to subtract 2018Q1 vs 2017Q1 for example.

• ###### 1. Re: Creating a difference on a measure across the dimensions of year and quarter

At its simplest, you can make a quick table calc that does a running difference.  I did it for Measure 1 in the attached.  You will have to do each measure separately.

• ###### 2. Re: Creating a difference on a measure across the dimensions of year and quarter

Thanks for responding Joe,

I've taken a look at the workbook you have sent back and I think I understand what the method your using here. Is there a way to change this method with the table calucations so  that it takes the difference from Q1 2018 vs Q1 2017. The calucation in the work book you were so kind to help with take the difference from Q2 2017 vs Q1 2017.

I would like to get the number for the change of Q1 to be what is below

In the tableau book attached we are getting .....

1 of 1 people found this helpful
• ###### 3. Re: Creating a difference on a measure across the dimensions of year and quarter

See attached.

Tableau makes its own table calc when you do a quick table calc.  You can make your own calc to do what you want it to do.  The easy way to get the right syntax from a quick table calc and modify it is to create your own new calc, and just drag the pill for the existing quick table calc into the edit window.

That's what I did for [My Difference Calc].  And once that was in there, I changed the LOOKUP that Tableau made so that it looks back 4 hops instead of just 1.  (Make your own and see that Tableau is doing LOOKUP -1.  I just changed that to LOOKUP -4.)

1 of 1 people found this helpful
• ###### 4. Re: Creating a difference on a measure across the dimensions of year and quarter

Joe,

I got  it I had to create a calculated field, for Quarter using

I don't know if because my year/quarter is coming through differently than tableau can read it or what. Then I used the new Quarter dimension and followed your direction on the table calculation

Now I'm getting Q1 2018 - Q1 2017 of 241,782 and all the other year/quarter comparisons are correct

Thanks Man!

• ###### 5. Re: Creating a difference on a measure across the dimensions of year and quarter

Joe, thanks so much for a great education here now the workings of Tableau,

can't tell you how much I appreciate it.

M. Dietz Niesen Finance Manager - Master Black Belt

T: 269-923-4085 | Whirlpool Corporation | www.WhirlpoolCorp.com

Please consider the environment before printing this e-mail

On Thu, Nov 29, 2018 at 3:29 PM Joe Oppelt <tableaucommunity@tableau.com>