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.
Have you tried a prompt macro? Most of the time they are evaluated at runtime, so that may keep the prompt optional.
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!
i wonder if a space can make a difference or cognos will treat the same. :o
#prompt('promptA','token',' ')#