Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

11 Replies
tresesco
MVP
MVP

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