COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jd on 12 Mar 2010 10:39:39 AM

Title: How to get Quarter from Datereceived column
Post by: jd on 12 Mar 2010 10:39:39 AM
Hi all

I have date Received column in report studio report.
I am trying to get the year/quarter/month from that column. I am able to get year and Month using extract function.
ex: extract (Year,[Date Received])
extract (month,[Date Received])

I got stuck with quarter. Above function is not working for the quarter. Anybody have any idea hwo to get quarter from the Datereceived column.

Thanks,
Title: Re: How to get Quarter from Datereceived column
Post by: CognosAdmn on 12 Mar 2010 11:57:32 AM
how about using an if-then-else function

if (month in ('jan','feb','mar')) then ('Q1')
else if (month in ('apr','may','jun')) then ('Q2')
etc....