COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: everlearner on 21 Jun 2012 04:22:04 AM

Title: on the basis of selection need to display date prompt
Post by: everlearner on 21 Jun 2012 04:22:04 AM
Hi Gurus,

my req is, user has to select/enter either start or end date ( date should be in range).

i have taken a value prompt with 2 options, when he select  start ,then i have to display start date prompt ,
when he select end, then need to display end date prompt in the same page.

my question is when user select a option from value prompt, how can i show  date prompt automatically? or after selection need to put any button to show date prompt?


how can do this? can any one help me in this regard.
Title: Re: on the basis of selection need to display date prompt
Post by: hemantsoni on 21 Jun 2012 08:04:47 AM

Hi,
After you add all the prompt to your prompt page define a string variable.
If '?parameter1?'='Start' then 'start'
else
'end'
where parameter1 is the parameter of the date prompt

Add two values for your string variable:start and end then render the prompts using render variable.

You can also set box type='None' for the prompts.

Same thing can be achieved using a  case statement.
You can also use a Boolean variable.



Title: Re: on the basis of selection need to display date prompt
Post by: hemantsoni on 21 Jun 2012 10:01:47 AM

Just a small correction instead of '?Parameter1?' just drag the Parameter1 it will be somewhat like this:
ParamDisplayValue('Parameter1')
Title: Re: on the basis of selection need to display date prompt
Post by: bi4u2 on 25 Jun 2012 08:20:55 AM
Everlearner, you do not need two parameters, you can structure the filter in the query like this: Date in_range ?pDateRange?, by using the range properties it will display 2 data prompts.