COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jschmidt on 07 May 2010 12:52:55 PM

Title: How to filter cube data for past 12 months from current day?
Post by: jschmidt on 07 May 2010 12:52:55 PM
We have OLAP cube set up, and it has a time dimension like Year-Quarter-Month-Week-Day, there is a current day member, and I need to filter data for last 12 months from current day. It needs to be dynamic and change daily. I know how to do it with relational data, but those date functions do not work with dimensional data. I am new to dimensional report design, does anyone know the function or date calculation which would filter the data for past 12 months? I am using Cognos Report Studio 8.42.....

Thanks,

Jeff
Title: Re: How to filter cube data for past 12 months from current day?
Post by: rockytopmark on 11 May 2010 01:46:19 PM
From the Tips in the expression editor:

lastPeriods ( integer_exp , member )
Returns the set of members from the same level that ends with the specified member. The number of members returned is the absolute value of "integer_exp".  If "integer_exp" is negative, members following and including the specified member are returned. Typically used with a time dimension.

So for your application, you might try:

lastPeriods(365,[your_current_date_member])