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

Parameter display Value question

Started by actcognosuser, 03 Dec 2021 01:00:27 PM

Previous topic - Next topic

actcognosuser

Hello,

How do you display "ALL' when Select all is clicked in a value prompt?
I have a tried the following options with no luck.

CASE
WHEN (ParamDisplayValue('ABC') is missing)
then ('All')
ELSE (ParamDisplayValue('ABC'))
END

Parameter display value ABC is a concatenated value of area code and Area name.

When 3-4 areas are selected , the paramcount(paramvalue('ABC')) is returning zero.



Please advise.

MFGF

Quote from: actcognosuser on 03 Dec 2021 01:00:27 PM
Hello,

How do you display "ALL' when Select all is clicked in a value prompt?
I have a tried the following options with no luck.

CASE
WHEN (ParamDisplayValue('ABC') is missing)
then ('All')
ELSE (ParamDisplayValue('ABC'))
END

Parameter display value ABC is a concatenated value of area code and Area name.

When 3-4 areas are selected , the paramcount(paramvalue('ABC')) is returning zero.



Please advise.

Hi,

ParamDisplayValue() and ParamValue() are functions you can use in a layout calculation but not a query calculation. Where are you using your expression?

If the user chooses the 'Select All' option from the prompt, the parameter would contain all the values from the prompt, separated by commas and spaces - eg 'Camping Equipment, Golf Equipment, Mountaineering Equipment, Outdoor Protection, Personal Accessories'

You could code a layout calculation that had an expression like this:

if (ParamDisplayValue('yourParameter') = 'Camping Equipment, Golf Equipment, Mountaineering Equipment, Outdoor Protection, Personal Accessories') then ('ALL') else ParamDisplayValue('yourParameter')

Cheers!

MF.
Meep!

actcognosuser

HI MFGF,

I am using a layout calculation . If there are 100 regions, it is wise to list all of the regions in the layout expression or is there a better way to resolve this?

dougp

I generally encourage users to use the "Deselect All" option to select everything (ignore this filter).  "Select All" can make for a slow query.

actcognosuser

Hi MFGF,

The solution with comma separated values is not working for multiple values though it is a multiselect value prompt.

It shows all the values instead 'ALL'.

if (paramdisplayvalue('?reg?) in ('A' , 'B', 'C'))
then('ALL')
else (paramdisplayvalue('?reg?))

Output is A, B , C

MFGF

Quote from: actcognosuser on 14 Dec 2021 11:06:18 AM
Hi MFGF,

The solution with comma separated values is not working for multiple values though it is a multiselect value prompt.

It shows all the values instead 'ALL'.

if (paramdisplayvalue('?reg?) in ('A' , 'B', 'C'))
then('ALL')
else (paramdisplayvalue('?reg?))

Output is A, B , C

The syntax you are using is different than the expression I posted. My expression uses an = operator, but you have substituted this with 'in'.

Cheers!

MF.
Meep!

actcognosuser

Using  '= ' yields a parsing error. For a multiselect value prompt don't we need the in operator?

dougp

It's more than just the =.  Take a look at the rest of your syntax.  paramdisplayvalue('?reg?) doesn't look right.  Try dragging in the parameter from the Available components: pane in the expression editor.