Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
manoj217
Creator III
Creator III

rolling da

i have a  straight table with month,year as dimension and sum(sales) as expression i want to create a rolling data like

Load * inline [year,month,sales

                    2000,jan,100

                    2000,feb,100

                    2000,mar,100

                    2000,apr,100

                    2000,jun,100

                    2000,ju;ly,100

                    2000,aug,100]

output:

year,month,sales,rollling month,rolling sales

                    2000,jan,100,

                    2000,feb,100,

                    2000,mar,100,

                    2000,apr,100, jan,100

                    2000,jun,100,feb,200

                    2000,ju;ly,100,mar,300

                    2000,aug,100,apr,400

how can i get the rolling data like this please suggest me

2 Replies
sunny_talwar

Use Above() function here

Capture.PNG

sunny_talwar

Change the second expression to this

=RangeSum(Above(Sum(sales), 3, RowNo()))

Capture.PNG