BookmarkSubscribeRSS Feed
johnfrytz
Obsidian | Level 7

I'm passing the selected values of the drop-down into the parameter.

When the selection is cleared , the parameter displays "<No item selected>".

I'm using the parameter in a calculation. It seems that the calculation is retaining the result for the first condition of the IF-ELSE statement.

Hence I wanted to know the equivalent value for "<No item selected>" to ensure I get the correct results.

1 REPLY 1
Stu_SAS
SAS Employee

When there is no selection in a single-valued parameter, it produces a missing value. For numeric parameters, it is a dot ., for characters, it is an empty space ' '

 

You can simplify this by using the missing() and notmissing() functions, which will automatically handle both numeric or character values. For example:

 

if(missing('parameter'p) ) return 1 else 0

 

If you are on SAS Viya, the isSet() function is a better alternative. isSet() returns True or False (1 or 0) depending on if a parameter has been selected. It can be used to get really great feedback on how someone is using the report. Plus, it works for both single-valued and multi-valued parameters.

 

if(isSet('parameter'p) ) return 1 else 0

 

Confirming Parameter Values

 

In case you ever need to confirm what the value of a parameter actually is in the background, here's a simple trick:

  1. Create a new calculated column and simply drag in the parameter:
    Stu_SAS_0-1635873630770.png
  2. Add a list table and add your calculated column as a row
  3. Select different values of your parameter to view its raw value 

     

    parameter-value-test.gif

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 823 views
  • 0 likes
  • 2 in conversation