4 Replies Latest reply: Nov 8, 2018 6:09 PM by Sumanth Gopi

# How can you calculate the variance of two columns in a pivot table?

Hi,

I have created a pivot table which has values as the rows and the financial year (FY18, FY19, etc) as the columns. I have calculated the different values as shown in the attachment. I am trying to insert a variance column after the FY19 column that calculates the variance between FY18 and FY19. Does anybody know how I can do that?

Any help on this would be much appreciated!

Regards,

Sumanth

• ###### Re: How can you calculate the variance of two columns in a pivot table?

Do you need this as  a pivot table ?

You can do this in a straight table using set analysis.

• ###### Re: How can you calculate the variance of two columns in a pivot table?

Hi Lisa,

In a straight table would I be able to get the calculated values (as shown in the image attached earlier) in the row and the dimension in the column. When I tried to do it, straight table does not have the option to do so! Hence I used pivot table.

• ###### Re: How can you calculate the variance of two columns in a pivot table?

Enable totals for the year dimension and use Dimensionality() or SecondaryDimensionality() to calculate the variance conditionally in the total column.

• ###### Re: How can you calculate the variance of two columns in a pivot table?

Hi Jonathan,

I am new to Qlik sense and never used Dimensionality. Can you please help me with the syntax or the process to do it?

Thanks.

• ###### Re: How can you calculate the variance of two columns in a pivot table?

Could you attach the sample data?