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

Using Style Variable in Report Author

Started by gosoccer, 27 Dec 2015 08:12:21 PM

Previous topic - Next topic

gosoccer

When the following is used:

If the checkbox Use Value is 1 and the Display value is 1-MD, which one of the below is correct?

if (ParamValue('state_param')  in ('1-MD')) then
('Y')
else
('N')

or

if (ParamValue('state_param')  in ('1')) then
('Y')
else
('N')

I'm trying to hide one or two columns depending on which one chosen: The column is Source Type Data Item Label: 1-MD.
So, I'm trying to assign the right Variable (Booleen) from above to this Column.
I'm also setting up Box type: None.

Now, when the user selects this option from the Check box, it should show it and
when a different option is selected, it shouldn't show it but it is not working and the
column is showing even though I didn't select it.

Could you please review my logic above and see if my Style Variable logic is incorrect?
or my approach in having the Column setup to Box Type is incorrect.

Thx so much for your time. I'm really stuck with this issue. If you have done it before to
have two columns to show when one is chose and one not, please share!!

8) 8)


cvamarley

ParamValue() -> Returns the use value of the parameter.
ParamDisplayValue() -> Returns the display value of the parameter.

So, the first one should be correct if you want to use the 'use value' of the parameter.

In your question, this one is correct :

if (ParamValue('state_param')  in ('1')) then
('Y')
else
('N')

gosoccer

Thank you for the information. I greatly appreciate it.
Well, I found out that the following was the issue. Sharing below with others with multiple values
are to be compared:

ParamValue('car_param') NOT IN ('1','2')

If 1 is selected the string passed in is just '1' and the expression works:

'1' NOT IN ('1','2') //Evaluates false

If 1 and 2 are selected, the string passed in is '1','2' and the expression no longer works:

'1','2' NOT IN ('1','2') //Evaluates true

The solution is to reverse the logic of the expression:

'1' NOT IN ParamValue('car_param') AND '2' NOT IN ParamValue('car_param')

Passing in 1 and 2 now results in this:

'1' NOT IN ('1','2') AND '2' NOT IN ('1','2') //Evaluates false

Thx. :) :)