COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: newyork66 on 13 Nov 2007 03:56:14 PM

Title: group by YEAR MONTH
Post by: newyork66 on 13 Nov 2007 03:56:14 PM
I have a date field, it's format in DB like this 'mm/dd/yyyy'. How do I group by by YEAR -Month in Report Studio?
Title: Re: group by YEAR MONTH
Post by: rockytopmark on 13 Nov 2007 05:13:41 PM
You should create a calculation that is returning just the month and year, from your date item. 

Use the Extract(datePart, [dateItem]) function to get the pieces and then concatenate them together, in a format you desire.

Then Use that calculated Year-Month item in the report and group on it.
Title: Re: group by YEAR MONTH
Post by: newyork66 on 14 Nov 2007 11:07:55 AM
Thank you! It works! :D