COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: tgs728 on 02 Apr 2014 01:06:51 AM

Title: rolling 12 months data
Post by: tgs728 on 02 Apr 2014 01:06:51 AM
HI All,

I have a requirement like this

year month qty
2013
Title: Re: rolling 12 months data
Post by: tgs728 on 02 Apr 2014 01:10:56 AM
Sorry for in complete post

Year    MOnth       qty
2013     01             25
2013     02             20
2013     03             10
2013     04             25
2013     05             30

My desired data should be as qty should be sum for previous 3 months data.


Year   Month       qty
2013   05           65(30+25+10)
2013   04            55(25+10+20) and so on


Please can any body suggest me on this..
Thanks TGS
Title: Re: rolling 12 months data
Post by: navissar on 02 Apr 2014 02:48:18 AM
If this is relational, use moving-total, something along these lines:
moving-total ([Quantity],3)
If this is dimensional, use something along these lines:
total([measure] within set (lastPeriods (3,currentMember ([cube].[time dim].[time hioerarchy]))))