COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: priya@90 on 16 Feb 2016 11:34:03 AM

Title: Get Quarters in Relational Model
Post by: priya@90 on 16 Feb 2016 11:34:03 AM
Hi All,

How to get quarters using below 2 data items 1. Month data item is having 2(means Feb and this has been done in ETL) in DB and Year data item is having 2016 and iam concatenating both iam getting 2,2016 and now i want to get quarters in my chart like Q1 2015, Q2,2015...Q42015..upto 8 quarter including current quarter.
iam trying this case statement but it's not working

Case when [concatenate] then 'Q1'
when [concatenate] then 'Q2'
else 'Q3'
end

How to execute to get the correct quarters. Iam using cognos 10.2.2 and Relational MOdel with DB2

Thanks,
Priya
Title: Re: Get Quarters in Relational Model
Post by: Deep750 on 16 Feb 2016 02:17:41 PM
Can't you make a case like

Case when [month] in (1; 2; 3)
then 'Q1'||' '|| [year]
when [month] in (4; 5; 6)
then 'Q2'||' '|| [year]
etc etc

?
Title: Re: Get Quarters in Relational Model
Post by: priya@90 on 17 Feb 2016 12:35:29 AM
Thanks Deep. It's working as expected
Title: Re: Get Quarters in Relational Model
Post by: priya@90 on 17 Feb 2016 09:21:49 AM
How to get count for every quarter like Jan(1)=10, Feb(2)=20, mar(3)=30 so I want to get as quarter1 total q1,206=60
Title: Re: Get Quarters in Relational Model
Post by: priya@90 on 18 Feb 2016 07:01:01 AM
done. count(data item) for [dataitem2]. [dataitem2] is above case statement and [data item] is month.

Thanks,
Priya.