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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Spend Difference between two period (Latest vs. Previous)

Hello folks,

Please bare with me here, it has been a while since I have used Qlikview and my scripting kinda sux.

I have a table like below:

  

MonthDifference in QVSpendDifference in Excel
Jan.00%39487.350%
Feb29.12%32966.90-17%
Mar-130.54%62196.3189%
Apr-162.46%98574.4958%
May198.05%54227.70-45%
Jun-28.49%60607.8512%
Jul88.07%40886.58-33%
Aug-115.66%66783.8063%
Sep75.37%49907.69-25%
Oct113.39%24518.73-51%
Nov79.04%6821.38-72%
Dec-45.88%17095.73151%

I am trying to get the spend difference between the latest period and the previous period.

In QV, I used this formula : if(RowNo() = 1,0,sum(cost) - Above(sum(cost)))

Please advise, what am I doing wrong here. Thanks a lot in advance.

1 Solution

Accepted Solutions
sunny_talwar

If you need percentage, then may be this:

If(RowNo() = 1,0, (Sum(cost) - Above(Sum(cost))/Above(Sum(cost)))

View solution in original post

2 Replies
sunny_talwar

If you need percentage, then may be this:

If(RowNo() = 1,0, (Sum(cost) - Above(Sum(cost))/Above(Sum(cost)))

Not applicable
Author

Thank you, Sunny. Will try.