# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

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:

 Month Difference in QV Spend Difference in Excel Jan .00% 39487.35 0% Feb 29.12% 32966.90 -17% Mar -130.54% 62196.31 89% Apr -162.46% 98574.49 58% May 198.05% 54227.70 -45% Jun -28.49% 60607.85 12% Jul 88.07% 40886.58 -33% Aug -115.66% 66783.80 63% Sep 75.37% 49907.69 -25% Oct 113.39% 24518.73 -51% Nov 79.04% 6821.38 -72% Dec -45.88% 17095.73 151%

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)))

Tags (1)
1 Solution

Accepted Solutions
MVP

## 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
MVP

## 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.

Community Browser