Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

full cummulated sum script

Hi Guys,

how can I use the cummulative sum in script like in expression:

rangesum(above(Sum(Quantity),0,rowno()))

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

Labels (1)
11 Replies
tresB
Champion III
Champion III

LOAD Articleno,

    Date,

    //StockValueAccuExp,

    If(Articleno=Peek(Articleno),RangeSum(Peek(StockValueAccuExp), "sum[stockValue (aktual)])"), "sum[stockValue (aktual)])") as StockValueAccuExp,

    "sum[stockValue (aktual)])",

    //QuantityAccuExp,

    If(Articleno=Peek(Articleno),RangeSum(Peek(QuantityAccuExp),  [sum(Quantity)]),  [sum(Quantity)]) as QuantityAccuExp,

    [sum(Quantity)]

FROM

....

(biff, embedded labels, header is 2 lines, table is Sheet1$);

PFA

Not applicable
Author

Now I get various values on each day, one of them is the right one. (excel result)

Because that in the sum(quantity) and sum(stockvalue ) from the excel, is sum into 1 value of each day..

but how can I sum that in script?

If I use sum(Quantity) or sum(stockvalue) in each if-conditions, = invalid expression error