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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Applying above with more than one row in script

Hi,

as we know, the above function does not work at scriptlevel.

So, im looking for something like that at scriptlevel:

rangesum(above(Value,0,rowno()+11))

Sure, there are the previous or peek functions, but to my knowledge these wont take a range of rows like 'above' for whatever reason....

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Manish,

thx for your quick reply.

It works for me like so:

rangesum(Value, peek(Value, -1),peek(Value, -2),peek(Value, -3),.......) as Rolling12MontsValue

Not really elegant but its easy to implement and works.

View solution in original post

3 Replies
MK_QSL
MVP
MVP

You have to create some flag to count number and use them with if condition.

But better to have a look into below blog post...

Calculating rolling n-period totals, averages or other aggregations

Anonymous
Not applicable
Author

Hi Manish,

thx for your quick reply.

It works for me like so:

rangesum(Value, peek(Value, -1),peek(Value, -2),peek(Value, -3),.......) as Rolling12MontsValue

Not really elegant but its easy to implement and works.

MK_QSL
MVP
MVP

Great that you got expression. Try to implement the same using the link provide above in my first reply. If you want RollingValues, this is the best approach.