In the past when working on Visual Analytics (version 3 I think), I could use
if ()
return ()
else ()
And have used that in the past quite a few times with parameters for a search text input field. E.g.:
IF (notmissing('parameter_name'p))
RETURN (Contains(comlumm_name, 'parameter_name'p))
ELSE (1 == 1)Note: very basic example, which when nothing is typed in the search field will show all results, otherwise only those which contain the search text.
However, since VA is updated to Viya, version 4 I believe, I get this:
Anyone any ideas why? Did something change in VA 4?
I am also unable to find a solution that achieves the same, where I can use the text input with wildcard search to return all similar results.
Nb: suggestion that a text-input field with the data-column to search as a data-field is not useful for two reasons:
1. I require to search in multiple columns at once
2. You only return the exact result. So if searching for "cat", you options "cats" and "caterpillar", but when selecting either of them, you don't get the other, whereas I want to show both.
Hey @RVO! The reason you are getting this error is because you only need one = rather than two. For example:
if (1=1)
return 1=1
else 0=0
Also, in Viya 4 you can add comments with // or /* */!
Here's an example video I have of implementing this text search filter here:
https://youtu.be/iMtoJXDZVRk?si=aVoWXR6gQ5GqCO_f&t=182
Hey @RVO! The reason you are getting this error is because you only need one = rather than two. For example:
if (1=1)
return 1=1
else 0=0
Also, in Viya 4 you can add comments with // or /* */!
Here's an example video I have of implementing this text search filter here:
https://youtu.be/iMtoJXDZVRk?si=aVoWXR6gQ5GqCO_f&t=182
The double "=" to single worked, thanks for the help.
Did not know this changed (it is not hinted at when using the if..else formula). A good change, was always strange in previous VA version to use "==", but a good example how inconsistency between version can cause problems 🙂
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.