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.
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:
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!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.