2 Replies Latest reply on Mar 18, 2013 4:57 PM by Gareth Jones

# Comparing the percentage change between the sum of two columns

Hi

I did a good search prior, so I apologise if I have missed an explanation to this somewhere.

Basically, my data is set out as such:

Customer
Status on ArrivalStatus on Departure
1BananaOrange
2OrangeBanana
3AppleApple
4OrangeApple

Basically, I am after a set of results that look like this:

Status on Departure
# Records% of Total% Difference
Banana

5

25%-3%
Orange525%5%
Apple1050%-9%

Where % difference is a comparison to the % of total from the Status on Arrival.  Basically, I just want to subtract the % on Departure from the % on Arrival.  I don't mind if the status on Arrival shows in the table at the same time.

Any help would be greatly appreciated.

Thanks

Gareth

• ###### 1. Re: Comparing the percentage change between the sum of two columns

Hi Gareth,

I think that with the data sample you showed in image 1, it will not be possible to calculate as you suggest.

You are looking to group by either departure or arrival, but then count outside the group. I don't think that is possible.

If it is possible to change the data format a bit however it is easy to do.

Attached is an excel sheet with sheet1 - your format and sheet2 - new format that is easier to calculate. I think there is an excel addon available from Tableau that might help you change the shape of your data to match.

From sheet 1, I could not find any way to make as you required.
From sheet 2 it is not too complicated - see tableau workbook also in attached zip.

Hope this helps,

Dana

• ###### 2. Re: Comparing the percentage change between the sum of two columns

Hi Dana

Thank you for that - I understand what you mean now, that example was perfect.

My data comes in a continuous live flow in the format I have specified, I don't suppose you or anyone else has any ideas on how to dynamically convert my columns into the format you specified?  Weather it be with a select or even in Excel.

Thanks!

Gareth