Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Cap
Contributor II
Contributor II

How to make operation between column in a Pivot Table

Hello,

here is a screen of the data:

Capture d’écran (219).png

 

I would like to be able to make a Current Year / Last Year Ratio (for example 114.24€/38.15€) but i can't find the correct expression for it.

I tried:

sum({<Year={"$(=Year)"}>}Sales)/sum({<Year={"$(=Year-1)"}>}Sales)

It is returning me a null value unfortunately 😞

What am i missing please ?

Labels (1)
3 Replies
sidhiq91
Specialist II
Specialist II

@Cap  I see the approach is right for calculating the ratio. Would you make the changes as shown below and see if that is working for you.

(Sum({<Year={"$(=Max(Year))"}>}Sales)/Sum({<Year={"$(=Max(Year)-1)"}>}Sales))

If it did, please like and accept it as a solution.

Cap
Contributor II
Contributor II
Author

Hello Sidhiq91,

Unfortunately it doesn't and send 0 for each value 😞

If i set the expression to :

Sum({<Year={"$(=Max(Year))"}>}Sales)

Every value is equal to zero EXCEPT for the colum equivalent to max year (in this case 2020), same process if i put max(year)-1 -> 2019, etc.

The expression doesn't seem to work if the <Year> is not correspondant to the collumn selection, witch i don't understand at all

 

sidhiq91
Specialist II
Specialist II

@Cap  Could you please provide me some sample data? Let me try to work it out for you.