1 2 Previous Next 19 Replies Latest reply on Oct 25, 2016 1:08 AM by Simon Runc

# Show Difference for various measures in a new column

I have the following data:

 Date Location Item Price Cost Sold 1/1/2016 USA Item 1 \$10 \$3 \$20 1/1/2016 USA Item 2 \$20 \$10 \$20 1/1/2016 USA Item 3 \$30 \$15 \$20 1/1/2016 Europe Item 1 \$2 \$2 \$20 1/1/2016 Europe Item 2 \$5 \$5 \$20 2/1/2016 USA Item 1 \$9 \$7 \$20 2/1/2016 USA Item 2 \$7 \$5 \$20 2/1/2016 USA Item 3 \$5 \$4 \$20 2/1/2016 Europe Item 1 \$2 \$2 \$20 2/1/2016 Europe Item 2 \$5 \$5 \$20 3/1/2016 USA Item 1 \$1 \$1 \$1 3/1/2016 USA Item 2 \$1 \$1 \$1 3/1/2016 USA Item 3 \$1 \$1 \$1 3/1/2016 Europe Item 1 \$1 \$1 \$1 3/1/2016 Europe Item 2 \$1 \$1 \$1

I would like to show a Tableau table looking exactly like this:

 2/1/2016 1/1/2016 Difference Price \$60 \$21 \$39 Cost \$28 \$16 \$12 Sold \$60 \$60 \$0

The issue is I can't get the difference column to show up on the same worksheet.  I understand I can create two worksheets, one showing the data, and one showing the differences, and showing them together in a dashboard.  But is there any ways to get them on the same worksheet?

• ###### 1. Re: Show Difference for various measures in a new column

Hi Henry,

Find below my approach based on pivot- and "Quick Table calc-Difference" and stored in attached workbook version 9.3

• ###### 2. Re: Show Difference for various measures in a new column

Thanks for your reply Norbert.  Unfortunately I do not have v9.3 yet so I wasn't able to open your file.  Do you have it in 9.0? If not, can you briefly describe the steps you did?

From what I'm seeing in your screenshots, it's not exactly what I'm looking for.  I don't want to show 3/1/2016 data, I want to show the difference for cost, price, and sold between two separate dates (in this case, 2/1 and 1/1) in a third column on the worksheet.

Thanks again.

• ###### 3. Re: Show Difference for various measures in a new column

Hi Henry,

Find my slightly adjusted approach in attached workbook version 9.0.

• ###### 4. Re: Show Difference for various measures in a new column

Thanks for the v9.0 version.  While it gets me the figures that I need, my question is more about the presentation of the results.  I'm trying to figure out a way to show the 1/1 and 2/1 figures and the difference between them all on the same worksheet (in the way I had posted in my original post).  We can certainly put together two separate worksheets to create a view showing that, but this should be something that should be very simple in Tableau, yet isn't.  I've had this question asked of me numerous times, and it's certainly frustrating to see that there doesn't seem to be a way to do this on Tableau.

• ###### 5. Re: Show Difference for various measures in a new column

Hi Henry,

Find below my "improved" approach based on one Worksheet and stored in attached workbook in version 9.0

Hope it's more "appealing";)

PS if you would like to have the Header "Dynamic" then we can add it based on the following "How to"

1 of 1 people found this helpful
• ###### 6. Re: Show Difference for various measures in a new column

This is more helpful, but unfortunately I cannot pivot the data as you've done due to certain client requirements, so I will need to take the data as it is presented to create the difference table.  Is that possible?

• ###### 7. Re: Show Difference for various measures in a new column

Hi Henry,

Considering your have to stick to the way the data is presented find my approach below and stored in workbook version 9.0

Not ideal but may be durable;)

• ###### 8. Re: Show Difference for various measures in a new column

Thanks Norbert.  It's not ideal, but at least it's all on one worksheet.  The duplicate of the delta values does make it confusing though.  I don't think I'll be able to use this, but I do appreciate the effort.

It's both disappointing and frustrating that trying to create a simple difference table on Tableau requires this much headache.  This is an incredibly common use case and I'm surprised that Tableau has not rolled out with a simpler solution to do this.

• ###### 9. Re: Show Difference for various measures in a new column

Henry,

Never say never at Tableau;) We will ask the real ""Guru's" here on the block.

Hi Simon Runc could you "shine your light" on this one.

Upfront thanks a TON!

Have a nice one.

• ###### 10. Re: Show Difference for various measures in a new column

Thanks for Ping Norbert..."that can't be done in Tableau" is like a red-rag!!

Hi Henry,

So yes this isn't the easiest (most intuitive) thing to do in Tableau....at it's heart Tableau is a data-visualisation tool, and as such prioritises (IMHO, anyway) data-viz over tables. To do what you want, would break the Aggregate/Pill philosophy at the centre of "how Tableau thinks"...so although a change to this would make this kind of thing easier, the other data-viz stuff you do 90% of the time would be much harder. So they make it that the stuff you do 90% of the time is fast and easy, and you have to work a little harder for the 10%!! - rant over!

Just got a couple of questions....

Do you always want to show the last 2 days?

and if not would you always look at any 2 dates?

If you can let me know on the above, I'll take a look and get you something over tomorrow.

• ###### 11. Re: Show Difference for various measures in a new column

Hi Simon,

To answer your questions - I would want to look at only 2 dates, and those 2 dates should be user-driven.  In my attached workbook, I've created 2 parameters dates for users to select.

I understand the underlying thinking behind the Aggregate/Pill philosophy, but it just seems that there should be some additional "options" that should make something like this much easier...For example, we have options to add rows and column totals for summing up figures at all levels.  It seems to me that this is a common enough use case to warrant developing some functionality to generate such tables.

Thanks for taking a look at this issue! Look forward to hearing from you.

Henry

• ###### 12. Re: Show Difference for various measures in a new column

Thanks for the follow-up. Much appreciated.

Keep me in the loop on this one. Most interested where we will end up.

Have a nice one.

• ###### 13. Re: Show Difference for various measures in a new column

Hi Henry,

You've mentioned totals,

so Custom Totals are used.

Yours,

Yuri

PS Hopefully Simon wouldn't mind

taking a little breath (or break? I'm not sure).

2 of 2 people found this helpful
• ###### 14. Re: Show Difference for various measures in a new column

Yuriy,

Thank you for the solution! This is exactly what I wanted.  It certainly looks simple now that I'm looking at it

Very nice work!!

Thanks,

Henry

1 2 Previous Next