Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi qlikview communtity,
I am trying to make a accumulative sum in the script but nothing seems to work. I have the belowtable:
Date | EmplRef | MinutesWorked | FlexGained |
59 | |||
14/10/2013 | FL238 | 464 | -16 |
15/10/2013 | FL238 | 481 | 1 |
16/10/2013 | FL238 | 513 | 33 |
17/10/2013 | FL238 | 481 | 1 |
21/10/2013 | FL238 | 465 | -15 |
22/10/2013 | FL238 | 535 | 55 |
I have managed to do it on a straight table but I need it inside the script.
Already tried:
RangeSum(FlexGained,peek(AccumFlexGained)) as AccumFlexGained
but i got some lagre negative numbers back isted of an accurate result
Any ideas???
Im sorry for my english but this works Niko :
Primero:
LOAD * Inline [
Date,EmplRef,MinutesWorked,FlexGained
14/10/2013, FL238 ,464, -16
15/10/2013 ,FL238 ,481 ,1
16/10/2013 ,FL238 ,513 ,33
17/10/2013 ,FL238 ,481 ,1
21/10/2013 ,FL238 ,465 ,-15
22/10/2013 ,FL238, 535 ,55
];
Segunda:
load
Date,
EmplRef,
MinutesWorked,
FlexGained,
RangeSum(FlexGained,peek(AccumFlexGained)) as AccumFlexGained
Resident Primero;
DROP TABLE Primero;
Regards!
Hi Raul and thanks for the quick responce,
I can see that it works on your version but the behaviour on my impementation is not the same.
I use the exact same formula to calculate the running average but insted I get numbers like -6607388,-6607185
and so forth.
I can not figure out why is that....
Can anyone help?? Has anyone had any similar issue??
Any ideas??? I have been trying everything but with no luck..
Could you share your sample app?
Here is a sample,
I it took me a minute to hide some sensitive information.
As you can see in the employee number = FL238 i what i am accually trying to achieve is to reset the flex to 480 if its more than that every friday and to keep accumulating from that flex afterwards. I would appreciate your help
Hi,
A quick fix before going into details; try putting single quotes around field name in peek() like:
RangeSum(FlexGained,peek('AccumFlexGained')) as AccumFlexGained