COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: v2k4u on 28 Jun 2013 10:51:16 AM

Title: how to convert a date prompt into a quarter when the user selects the date
Post by: v2k4u on 28 Jun 2013 10:51:16 AM
how to convert a date prompt into a quarter when the user selects the date.The date should be converted into the querterly data and then i am supposed to calculate the 8 previous quarters data based on the selected date in the date prompt.
Title: Re: how to convert a date prompt into a quarter when the user selects the date
Post by: Dineshkumar on 02 Jul 2013 05:59:27 AM
Hi,

Can u explain it more clearly?

-Dinesh
Title: Re: how to convert a date prompt into a quarter when the user selects the date
Post by: Mohanakrishnak on 03 Jul 2013 10:07:56 AM
Below Expressions May Helpful to you..

case
when
extract(month,?p_date?) in (1,2,3)
then
'Q1'
when
extract(month,[Date Field]) in (4,5,6)
then
'Q2'
when
extract(month,[Date Field]) in (7,8,9)
then
'Q3'
else
'Q4'
end

And Based on the Quarter You can Go back and take the Previous 8 Qurters.

....etc