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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Lyndon921
Contributor
Contributor

RangAvg(After()) on Script

Hi All,

This is my raw data(table1) and i want to use rangeavg Calculate the average for the next three months by site(table2)

WHY I Want on Script Because after i want to use mode to Diplay .

table1

SITE COMPANY YEARMON QTY
Taiwan LKINTEC 202209 100
Taiwan LKINTEC 202210 200
Taiwan LKINTEC 202211 300
USA APPLE 202209 400
USA APPLE 202210 500
USA APPLE 202211 600

chart

SITE COMPANY YEARMON QTY
Taiwan LKINTEC 202209 200
Taiwan LKINTEC 202210 250
Taiwan LJINTEC 202211 300
USA APPLE 202209 500
USA APPLE 202210 550
USA APPLE 202211 600
Labels (1)
1 Reply
rubenmarin

Hi, I'm not sure to undertand your question... after is a chart function, so it can't be used in script. In script you have the ppek() function to go to previous rows, so you can load using the order you need (from bottom to top of the table) and use peek() to access the previous row (which would be the next on chart)