Qlik Community

Ask a Question

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor III
Contributor III

How to add last 6 months rolling data in month wise

Hi ,

Could you please any one guide me how to add last 12 months rolling data in month wise.

we have data 2016 to 2019 August

Dimension:- Market and Year_Month

Measure- Sales

This first table we are showing last 12 months data Month wise.

MarketSep-18Oct-18Nov-18Dec-18Jan-19Feb-19Mar-19Apr-19May-19Jun-19Jul-19Aug-19
Benelux201020102010201010301020

 

So in 2nd Table we want to show Aug-2019 data should be addition of last 6 months data from 1st table.

same way other months data should be last 6 months data(That's highlighted in bold)

Right now i provided sample data only

MarketSep-18Oct-18Nov-18Dec-18Jan-19Feb-19Mar-19Apr-19May-19Jun-19Jul-19Aug-19
Benelux20102010209090908010090100
3 Replies
Partner
Partner

Try something like this

sum( aggr( rangesum( above( total sum( {<Year=, Month=, Year_Month=>} Sales),0,6)),[Year_Month]))

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Partner
Partner

An alternative to my previous suggestion is to look into the as of table. With the as of table your expression gets simpler, you don't need to bother with all the rangesums and aggrs.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Digital Support
Digital Support

See duplicate post too: https://community.qlik.com/t5/QlikView-App-Development/How-to-add-last-6-months-rolling-data-in-mont...

Regards,
Brett

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.