Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of Running Difference

My Data looks something like this

IdNameValue
130A12
240A19
350A24
45f29
54g35
64h45

Now I want a measure which will be the sum of all the Differences that is

(19-12)+(24-19)+(29-24)+(35-29)+(45-35)
I am a newbie with Qlik please help in writing a query which helps solve this requirement

12 Replies
jvishnuram
Partner - Creator III
Partner - Creator III

Hi shashank,

use this expression,

Aggr((Sum(Value)-Above(Sum(Value))),Name)

Not applicable
Author

Hi Sunny, Anyway that I can Filter out just values that are like 'OA' in the above expression. When I filter out that would give me (19-12)+(24-19)

sunny_talwar

Is that 'OA' or '0A'? If its '0A' then you can try this expression:

=Sum(Aggr(Alt((Only({<Name = {'*0A'}>}Value) - Above(TOTAL Only({<Name = {'*0A'}>}Value))), 0), Id, Name, Value)) with Expression Total


Capture.PNG