Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
silvia_assuncao
Creator
Creator

How to calculate % by column in pivot table (differet years)

Hi, I have the file attached here and I'd like to calculate the % by year to each column.

Could any of you help me creating this expression?

imagem_qv.PNG


Labels (1)
5 Replies
sunny_talwar

Try this expression:

Sum(Price)/Sum(TOTAL <Year> Price)


Capture.PNG

silvia_assuncao
Creator
Creator
Author

Thank you!

but now I have a new situtation:

I want to sum only Pants and Shoes and I see that the % by year now is not corret:

erro 2.PNG

Sum(If(Product<>'Shoes',(Price))))
/
((
If(Product<>'Shoes',Sum(Total<Year>(Price)))))

sunny_talwar

Try this and see if it helps:

Sum({<Product -= {'Shoes'}>}Price) / Sum(TOTAL {<Product -= {'Shoes'}>}Price) //Note the negative sign in red

silvia_assuncao
Creator
Creator
Author

Yes! thanks a lot! you saved my day

sunny_talwar

Great

I am glad I was able to help

Best,

Sunny