Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dion1999
Contributor
Contributor

Variance P&L pivot

Hi there, I was trying to calculate simple  variance between current year and last year. 

This is my expression:

(Sum({$<FYEAR={'$(=Max(FYEAR))'}>} [IS.Budget_Amt]) - Sum({$<FYEAR={'$(=Max(FYEAR)-1)'}>} [IS.Budget_Amt]))/Sum({$<FYEAR={'$(=Max(FYEAR)-1)'}>} [IS.Budget_Amt])

 

dion1999_0-1637043928573.png

I wasn't getting expected results. Can someone tell me what's wrong.

 

3 Replies
rbartley
Specialist II
Specialist II

Hi,

Try:

(Sum(TOTAL {$<FYEAR={'$(=Max(FYEAR))'}>} [IS.Budget_Amt]) - Sum(TOTAL {$<FYEAR={'$(=Max(FYEAR)-1)'}>} [IS.Budget_Amt]))/Sum(TOTAL {$<FYEAR={'$(=Max(FYEAR)-1)'}>} [IS.Budget_Amt])

 

dion1999
Contributor
Contributor
Author

Hi, thanks for helping, but the results are not correct.

dion1999_0-1637057050329.png

 

This is what the data model look like. I feel like the problem might be on the data model side.  To present the data on P&L pivot extension, I have to group by and concatenate Budget amount with its two granulity of group. For example, Revenue | Net Course Income | $100, in the IS table, will have two records,  Revenue | $100 and Net Course Income | $100.

I hope my bad explanation can help you understand.

dion1999_1-1637057353208.png

 

 

rbartley
Specialist II
Specialist II

Please upload your app, changing the values if any are confidential.