COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: TerranceU on 23 Dec 2011 12:29:56 PM

Title: Creating dynamic Month Header
Post by: TerranceU on 23 Dec 2011 12:29:56 PM
I'm trying to create a dynamic header for my reports which shows the previous month.  I know this is probably an easy formula, any thoughts?
Title: Re: Creating dynamic Month Header
Post by: cognostechie on 23 Dec 2011 02:19:18 PM
It's pretty easy if you want to display that in the Report header but what exactly you want to display? The previous month name, year, both , date ?? and where exactly you want to display that? If you can post an example of how you want it to look, I can give you the exact syntax.
Title: Re: Creating dynamic Month Header
Post by: absriram on 27 Dec 2011 05:28:20 PM
Create a data item with this expression:

_add_months(current_date,-1)

You can now drag this item to the report page and format it as you wish.

Thanks,
Sriram.
http://cognosonsteroids.blogspot.com
Title: Re: Creating dynamic Month Header
Post by: TerranceU on 12 Jan 2012 04:32:57 PM
Awesome, it looks like that worked.  Thanks!