Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
43918084
Creator II
Creator II

Create Vairance column in Pivot Table

I have created a pivot table with 2 periods and want to add Variance column to show difference between previous period vs current period.

I have created a set analysis formula like below, but I do not get the correct result.

=(Sum({<[ACCTG DATE (P0045)]={$(=max([ACCTG DATE (P0045)]))}>}[FUNCTIONAL AMT(YTD)])
- Sum({<[ACCTG DATE (P0045)]={$(=min([ACCTG DATE (P0045)]))}>}[FUNCTIONAL AMT(YTD)]))

The result I want is

 FunctionFunctionVar
ACCTG DATE (P0045)201912312020013120200131 vs 20191231
Status20,191,23120,200,1318,900
Totals(19,510,795)(19,304,099)206,696
Exist(19,510,795)(19,304,099)206,696

 

But I get an incorrect result like below.  Hope I can get some guidance

 FunctionFunctionVarVar
ACCTG DATE (P0045)20191231202001312019123120200131
Status20,191,23120,200,13120,191,23120,200,131
Exist(19,510,795)(19,304,099)19,510,795(19,304,099)

 

10 Replies
43918084
Creator II
Creator II
Author

Thank you very much.  Do you mean modifying the script in Script editor? Or I need to remove some of the fields in the left hand side of the pivot that were collapsed ?