COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: benmor on 04 Feb 2011 06:25:01 AM

Title: Last 10 days from a cube
Post by: benmor on 04 Feb 2011 06:25:01 AM
How can I get numbers for the last 10 days in a report built on a Powercube? I suppose I will have to use i.e (_add_days(current_date, -10)) in some way.
This variable will then be used as filter on the date dimension in the cube.

Can someone give me some examples? Thanks!
Title: Re: Last 10 days from a cube
Post by: MFGF on 04 Feb 2011 07:26:20 AM
Hi,

If your time dimension does not include future dates, you could try the following expression in a query calculation:

lastPeriods(10,closingPeriod([day level of your time dimension]))

Regards,

MF.
Title: Re: Last 10 days from a cube
Post by: benmor on 08 Feb 2011 07:20:52 AM
It would have worked out fine, BUT I have future dates in my time dimension.

I would like to have the last 10 days from today (sysdate), but I don't know how to do that.