Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Difference between columns in a pivot table

Hello,

I have a pivot table, with the Year in columns. I have 2 measures for each year. How can i have a third column to display the difference between the measures in these two years.

                 2012               2013              Difference

               Sales, profit     Sales, profit       Sales%, profit%

Product A  300    25         350    75            ??           ??

Product B  .................

Product C

Find attached a sample application.

Thank you in advance for some possible solutions.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like attached, using a subtotal column and secondarydimensionality() together with chart inter record functions.

View solution in original post

5 Replies
swuehl
MVP
MVP

Maybe like attached, using a subtotal column and secondarydimensionality() together with chart inter record functions.

Not applicable
Author

Ingenious solution Swuehl!!

Else the other solution i was contemplating was using alternate states for the years.

But its ofcourse not the same thing.

Thank you once again!

Regards

Anonymous
Not applicable
Author

Do you have a qvf version of this? Thanks.

Anonymous
Not applicable
Author

Hi, I need your help to sort columns on difference value. I set the expression like following and it is giving difference value but cannot sort dimension sorted on Highest and lowest value. Can you help how to apply sort on dimension based on difference of values.

if(SecondaryDimensionality()=0,

num(last(sum(Sales))/first(sum(Sales))-1 ,'#.00%')

, sum(Sales)

)

Anonymous
Not applicable
Author

I applied rank function as difference value on sorting sometime not working if one period don't have any data.

So I changed Sort Express as following and set ascending in order and it work.

RANK(sum({<Year= {$(=max(Year))}>}Sales.NetAmount) - sum({<Year= {$(=max(Year)-1)}>}Sales.NetAmount))