5 Replies Latest reply: Oct 27, 2016 5:55 AM by Sunny Talwar

# Expression to calculate sum of a column in pivot table

Hi all,

I have a requirement as follows:

I have a pivot table with one dimension say, "Plant Name" and one expression which is "Expression1" with values as shown below. Now i need to have one more expression in my pivot table which has the following condition: Say for example, for "Plant Name" A, "Expression2" should be: value in "Expression1" (i.e. 20) divided by sum of the values in column "Expression1" (i.e. 60 in our case here) multiplied by 100.

Plant NameExpression1Expression2
A20(20/60)*100
B10(10/60)*100
C30(30/60)*100

Is it possible to achieve this in QlikView?

Any suggestions?

Thank you.

• ###### Re: Expression to calculate sum of a column in pivot table

Hi,

You can use the following expression (as Expression2) to achieve this result:

Expression1/sum(TOTAL Expression1)*100

If you want to show the result in percentage, you can change the expression to Expression1/sum(TOTAL Expression1) and format the number as %

Hope this helps you

Eduardo

• ###### Re: Expression to calculate sum of a column in pivot table

Hello Eduardo,

Thank you for the help.

This expression is working fine for the example that i have provided here, but somehow its not working with my original data. I will find out the reason for that.

Anyways thank you once again for the help.

Regards,

Apoorva

• ###### Re: Expression to calculate sum of a column in pivot table

Hi,

Let me ask you something: is there any other dimensionamento in your pivot table?

Eduardo

• ###### Re: Expression to calculate sum of a column in pivot table

Hi Eduardo,

No, there is no other dimension in my Pivot table except "Plant Name".

Thank you.

• ###### Re: Expression to calculate sum of a column in pivot table

What is the exact expression you are using?