# Qlik Brasil

Group community for Brazil users. discussion only in Portuguese.

Highlighted
Contributor

## 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?

Tags (2)
5 Replies
MVP

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

Try this expression:

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

Contributor

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

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:

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

MVP

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

Try this and see if it helps:

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

Contributor

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

Yes! thanks a lot! you saved my day

MVP

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

Great

I am glad I was able to help

Best,

Sunny