Hi,
I'm trying to put the ability to select mutliple items into a text input field so for example an user could enter in 3 different items and the table would come back showing all those 3 items.
I followed this post https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-use-text-input-for-multiple-selections-in...
and it works quite well bar if the user enters 2 items, it takes the 3rd item as blank so returns everything anyway
THis is the code I'm using in the filter
IF ( GetLength('GroupNameParameter'p) > 0 )
RETURN ( ( UpCase('Group Name'n) Contains UpCase(
'GroupNameInput1'n) ) OR ( UpCase('Group Name'n) Contains UpCase(
'GroupNameInput2'n) ) OR ( UpCase('Group Name'n) Contains UpCase(
'GroupNameInput3'n) ) )
ELSE ( 1 = 1 )
and in the calculated item
GetWord('GroupNameParameter'p, 3)
Ideally, I'd like it so if the user enters GroupA into the search box that's the only option that comes back, but if they enter GroupA;GroupB;GroupC into it all those return.
Atm, it does the latter part, but if I just enter GroupA, it returns everything.
Anyone any help on this or done something similar themselves?
Thanks,
Have not tested with VA7.5 but I suggest you test for missing values on your search value, and only if not missing apply the filter expression, else you return 0
See example below:
IF ( GetLength('makeList'p) > 0 ) RETURN ( ( IF ( 'makeS1'n NotMissing ) RETURN ( UpCase('Make'n) Contains UpCase('makeS1'n) ) ELSE ( 0 = 1 ) ) OR ( IF ( 'makeS2'n NotMissing ) RETURN ( UpCase('Make'n) Contains UpCase('makeS2'n) ) ELSE ( 0 = 1 ) ) ) ELSE ( 1 = 1 )
Have not tested with VA7.5 but I suggest you test for missing values on your search value, and only if not missing apply the filter expression, else you return 0
See example below:
IF ( GetLength('makeList'p) > 0 ) RETURN ( ( IF ( 'makeS1'n NotMissing ) RETURN ( UpCase('Make'n) Contains UpCase('makeS1'n) ) ELSE ( 0 = 1 ) ) OR ( IF ( 'makeS2'n NotMissing ) RETURN ( UpCase('Make'n) Contains UpCase('makeS2'n) ) ELSE ( 0 = 1 ) ) ) ELSE ( 1 = 1 )
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.