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

Optional prompt - Do not apply the filter if no values were selected

Started by Kathir, 01 Mar 2012 04:45:36 AM

Previous topic - Next topic

Kathir

Hi,

  I have to implement the following filter/prompt behavior in my report.

  I have 2 optional value prompts in my report.

  If the user select value for one prompt and does not select value for the 2nd prompt, then I should consider only the prompt selected and ignore the other prompt, means I should not apply the default behavior of optional prompt if nothing is selected.

on the other hand, If the user does not select values for both the prompt, then I should apply the default behavior( all values).

Kindly, suggest a way to accomplish this. Thanks for your time in advance.


blom0344

Hmm, looks like you exactly described the way optional prompts work (as designed), which means you can use them 'as is'.  Or am I missing your point?

absriram

Kathir,

What kind of prompts do you have, value prompts OR text box prompt or something else?

It is not sufficient if you set the prompt's "Required" property to "No". You should also make the corresponding filters as "Optional".

Also, make sure you are not using the prompt values in data item expressions. If you do, then the prompts become required.

Sriram.
http://www.cognosonsteroids.com

Kathir

Hi Blom0344,Sriram:

   Thank you.

  Let me try to describe the requirement,  I have 2 optional value prompts in my report, Terminals and Operators

  I have to implement the below behavior for the report

1. If the user selects a terminal from TerminalIDs prompt and does not select any operator from
OperatorIDs prompt , then
I should consider only the Terminal IDs and should not apply the default behaviour of optional prompt (
ALL) for OperatorIDs.
i.e. The report should have data only for the selected terminals and no operator related data should be
presented.
e.g. if the user selects only Terminal5 and no operator ids, then the report should have only Terminal5 related
info.

2. If the user selects a Operator from OperatorIDs prompt and does not select any terminal from
TerminalIDs prompt , then
I should consider only the OperatorIDs and should not apply the default behaviour of optional prompt (
ALL) for TerminalDs.
i.e. The report should have data only for the selected Operators and no terminal related data should
be presented.
e.g. If the user selects only 02 and no terminal ids, then the report should have only operator O2 related
info.

3. If the user selects both terminal and operator(Terminal1 and Operator2
) , then the report should be presented with both Terminal1 and Operator2 detaisl ( cognos
default prompt behavior )

4. If the user does not select any Operators and terminals , then the report should have both operator
and terminal data ( Default behavior of cognos optional prompt )

I found prompt macro with tokens/ prompt macro with default value, can be used, but the problem is,
I am not able to accomplish the behavior mentioned in 4, as the filter behavior got modified to select
none(by supplying a default value(None) for the prompt if the user doesnot select a value from the prompt)

Kindly, help me in this.

Lynn

Not sure what I'm missing but it sounds like you can just use optional prompts and render variables or conditional formatting to control displaying or hiding columns.

There is a paramCount function that you can use in a boolean variable or in an advanced conditional format expression to determine if operators or terminals were selected. Then hide or show the appropriate elements.

Doesn't sound like prompt macros are really required at all in this situation.


Kathir

Hi Lynn,
Thank you. I was able to accomplish the requirement using ParamCount() and conditional rendering.

  Thank you very much.