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

report variable to check whether optional prompt specified

Started by Greg, 20 Sep 2013 01:44:04 PM

Previous topic - Next topic

Greg

In my report I have an optional prompt and filter on Sales Rep.  I need to create a conditional block where if a sales rep is selected it will just show the sales rep name and if none is selected then it will show a drop down list of sales reps.  In order to do this I need a report variable that indicates whether a sales rep was selected.  So it seems that I need a query with a data item for the sales rep parameter, but if I define it like #prompt( 'pSalesRep', 'string', '' )# with an empty default value then the sales rep prompt becomes mandatory.  So how can I create a variable that will indicate whether a sales rep was selected for this optional prompt?  Thanks.

calson33

Try using this instead:
#prompt( 'pSalesRep', 'string', 'NONE' )#

and check for 'NONE' instead of an empty string.

Greg

But if I put 'NONE' as the default value then won't my filters by defalt filter for the value 'NONE'?

Greg

I just tried your suggestion and it works great.  Thanks!

calson33

had to go check a few things...

I might be over complicating it.

If you set up a boolean condition on whether your prompt is null or not - ParamValue('sales_rep') is null
and then set your conditional block to show your drop down when it is null (Yes) and hide it when it is not null (No).

No SQL involved.