COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: consultantshaz on 15 May 2010 12:08:35 PM

Title: using case when in filter in Report Studio
Post by: consultantshaz on 15 May 2010 12:08:35 PM
Hi Experts

Need your guidance on the follwing :

I have billcycle parameters and the two conditions based on these parameters
I want to filter the following conditions:

case
when (?billcycle? = 20100201)
then (20100201 and 20100231)
when (?billcycle? = 20100220)
then (20100220 and 20100305)
end

note:
20100231 is dynamic (_last_day_of_month)
20100305 is dynamic (example, eg. when ?billcycle? = 20100320 then
20100320 and 20100405 and so on)

if you have suggestions to make this a dynamic condition, thank you in
advance.


in the filter to be like this ( date between DataItem )
how this is possible?

Since its urgent appreciate your swift response.
Title: Re: using case when in filter in Report Studio
Post by: CognosPaul on 15 May 2010 03:47:00 PM
This can be done fairly easily with macros.

You can do something like this:

[DateStamp] between #timestampmask(prompt('pDate','date',$current_timestamp),'yyyymmdd')# and #timestampmask(_last_of_month(prompt('pDate','date',$current_timestamp),'yyyymmdd'))#
Title: Re: using case when in filter in Report Studio
Post by: consultantshaz on 16 May 2010 06:01:25 AM
Thanks for the reply .. I will apply and let you know.