BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
titan31
Quartz | Level 8

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,

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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 )

 

View solution in original post

2 REPLIES 2
BrunoMueller
SAS Super FREQ

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 )

 

titan31
Quartz | Level 8
Perfect,
That worked

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1224 views
  • 1 like
  • 2 in conversation