Discussion Board for collaboration on QlikView Scripting.
how can I use the cummulative sum in script like in expression:
I need the cummulated sum as a fix number, that can calulated forward or backward ..
I tried with Rangesum(Quantity,peek('Quantity',-1) )as AccuSumScript; but it doesn't work
Go to Solution.
No, in that case, it would a bit different. Try like:
If(Dim=Peek(Dim),RangeSum(Peek(NewValue), Value), Value) as NewValue;
Load * Inline [
One thing you have to make sure that - source data is properly sorted.
RangeSum(Peek(NewValue), Value) as NewValue;
I have forgot about the arcticles.
There are many articles, does it impair with this function?
"RangeSum(Peek(NewValue), Value) as NewValue;" didnt work:
RangeSum(Peek(NewValue), Quantity) as NewValue
Yes, its order by Date ASC;
but I dont get the same values as in the expression
acutally I ve got many articleNo, dates - on each date there are increase values and decrease values = quantity.
If(articleNo=Peek(articleNo),RangeSum(Peek(NewValue), Quantity), Quantity) as NewValue // = cummulated quantity
didnt work , also instead of articleNo -> Date .
Try to share a sample data in excel and insert a column with expected output.
You need to first order by articleNo and then by Date. Something like this
Order By articleNo, Date;
what I want is, to get the same accumulated values, which are in the expressions, into the script.
Because, if I select the year = 2014 of the date, it depends on the very first value, which is from 2007 ..
I think it would be easier to work with raw data rather than already aggregated data that you have shared. Can you share few 100 lines of raw data??
here we go