5 Replies Latest reply on Dec 26, 2017 2:30 AM by Yuriy Fal

Difference between dimensions

Hi All,

I want to calculate difference between values for east and west regions. I want to add third column that will show difference between order id, profit and avg profit. I've attached a .twbx file v10.3.

• 1. Re: Difference between dimensions

Hi Andrew,

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

1. D1. Count Order ID: COUNTD([Order ID])

2. D2. Profit avg:

3. D3. Delta count: ZN(COUNTD([Order ID])) - LOOKUP(ZN(COUNTD([Order ID])), -1)

4. D4. Delta avg Profit: ZN(AVG([Profit])) - LOOKUP(ZN(AVG([Profit])), -1)

5. D5. Delta Profit: ZN(SUM([Profit])) - LOOKUP(ZN(SUM([Profit])), -1)

6. Drag required objects to the indicated locations

Regards,

Norbert

1 of 1 people found this helpful
• 2. Re: Difference between dimensions

Hi Andrew,

You've asked me to help with this question. So my answer below.

Norbert had come first, and his solution is clean and simple. Mine is not.

In fact, it's a dirty and complicated trick using Custom Grand Totals.

I post it just to show (up :) there might be another way to get to the result.

For the logic behind Custom Totals, please refer to

the seminal blog article by Jonathan Drummey :

Customizing Grand Totals – Part 2 | Drawing with Numbers

Yours,

Yuri

1 of 1 people found this helpful
• 3. Re: Difference between dimensions

Hi Yuriy Fal ,

Thanks for that:)

As always there are "more roads to Rome" in Tableau. Starting "plain & simple" to "going completely wild";)

I will store your approach in my "treasure room"...

Have a nice one

Regards,

Norbert

1 of 1 people found this helpful
• 4. Re: Difference between dimensions

Thanks you so much guys for the answer. Can we mark multiple answers correct?

Happy holidays and new year!!

~AM

• 5. Re: Difference between dimensions

Andrew, you're welcome.

Nope, just pick one (FIFO imho).

Yours,

Yuri