Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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.

Tags (1)
1 Solution

Accepted Solutions

Re: Spend Difference between two period (Latest vs. Previous)

If you need percentage, then may be this:

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

2 Replies

Re: Spend Difference between two period (Latest vs. Previous)

If you need percentage, then may be this:

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

Not applicable

Re: Spend Difference between two period (Latest vs. Previous)

Thank you, Sunny. Will try.