If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Make Date prompt required/optional based on condition

Started by reshma19, 23 Jul 2012 04:55:27 AM

Previous topic - Next topic

reshma19

Hi

I have two date prompts "Start Date" and "End Date". When i run the report it should be optional parameter. If a user selects "Start Date" the "End Date" should become required parameter and vice versa.

User should select both together. So the query filter will be either optional or required

Can anyone help me with the javascript for this?

CoolP

Just set the date filter(s) as optional in the query. When the report is run, the user will be prompted to select the date, if he selects, the report will run for the selected dates, if he doesn't select any date, date filter will not be applied (as expected). It is the default behaviour..


Regrads
Prasan
CoolP
Aspiring BI/Cognos Professional

reshma19

I guess my question was not clear. What the user wants is when they run the report the date prompts should be displayed as "optional" parameters. But if they select any one date i.e "Start Date" or "End Date" the other date parameter should become required prompt.

e.g if he selects "Start Date" End Date should become required field in the prompt page.

i.e user should select both or none. He cannot select any one alone.

Wanted to know if this can be done using javascript. Please let me know. I need it in cognos 8.4 version

CoolP

Hi Reshma,
The only way i think of doing it without using javascript is by using 2 prompt pages and a reprompt. I have created a report against the GoSales Query Package.Spec is attached.

Cheers
Prasan
CoolP
Aspiring BI/Cognos Professional

tjohnson3050

You can use a single date range prompt.  It defaults to earliest and latest date, effectively giving you the same thing without any need for risky ( from a maintenance perspective) JavaScript.