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

Checking an optional prompt without making it required

Started by hespora, 08 May 2017 08:42:47 AM

Previous topic - Next topic

hespora

Hi there,


I have a report with two optional prompts, filtering Query1 on FieldA and FieldB. In my query, I need to detect which prompt has been used by the user, as different calculation depend on that. How do I actually do that without making the prompts required? Using ParamCount, ParamValue, or even "if (?promptA? is null)" all turn the prompt into required rather than optional.

bdbits

Have you tried a prompt macro? Most of the time they are evaluated at runtime, so that may keep the prompt optional.

hespora

I did, but I (actually! :D) had an idea in the shower about that this morning about what I might have done wrong - turns out that #prompt('promptA','token','')# makes a prompt required, wheras #prompt('promptA','token','defaultvalue')# does not. When I checked y-day I only checked with an empty default value (I figured an empty string is still a value; guess Cognos thinks otherwise).

Learning something new every day... :D Thanks for your help!

sdf

i wonder if a space can make a difference or cognos will treat the same.  :o
#prompt('promptA','token',' ')#