Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

On Demand Webinar: See Why Thousands of QlikView Users Have Switched to Qlik Sense. REGISTER
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

Rolling 30 Day Sum


I have a situation where I have sales for at a daily level starting from Jan 2020 to date at an SKU level. I want to show in the chart the months and the sales against it. The only condition is that it should always be the next 30 days sales.

For example: 

Jan ( 1st as nothing is selected)- Jan 30th : 2000

Feb(1st as nothing is selected)- Feb 29th :4000

and so on. As soon a user selects a day the bracket of 30 days should shift

The user selects 15 as a day:

Jan ( 15th)- Feb 15thth : 7000

Feb(15th)- Mar 16th :5000


In the below example I have selected 19th March but I get April (as the bracket is from 19th Mar - 19th Apr) also a month in the month which I don't want. I want the whole sum of 436932 in Mar bracket

 I used the below set analysis


vL3MEndNew: 19TH March

vRollingDays: 19th+30 days 


Can it be done using set analysis or do I have to write it in script??


3 Replies

Hi, I'm not sure of what you want and what are you getting.

Maybe you need to if¡gnore selections in selected month so only set analysis applies?

sum({<TRENDDATEMONTH={">$(=$(vL3MEndNew))<=$(=$(vRollingDays))"}, MonthFieldToIgnore>}[DAILY_SALES(Cases)])

Also, I would try to make the variable to return the values I want to usetoa ovid the double $(, like setting the content of vRollingDays variable to: =$(vL3MEndNew)+30

Support (Former)
Support (Former)

If Ruben's post got you what you needed, please be sure to close the thread by using the Accept as Solution button on his post.  This gives him credit for the help and lets other Members know it worked.  

The only additional thing I have to try to help is the following Design Blog post:



To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Contributor III
Contributor III


I suppose that you are using 'Month' as dimesion value, so I would add a calculated dimension and then I would create a single expression.


=aggr(only({<TRENDDATEMONTH={">$(=(vL3MEndNew))<=$(=(vRollingDays))"}>} YourMonthDimension),YourMonthDimension)




I normally use it like that. The difference is that in my case I always create a variable 'vRolling' and I use an input box to select the number of days, month, years that I want to select backwards or forwards.


Example considering the number of 'vRollingMonth' backwards "selected in an input box" from month(today)



Hope that works for you.