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

Hi.

Our aim is to have a list table showing only records that match one value typed inside text input control.

 

I have create a new parameter with default value like this "select state". Applied that parameter to text input control. And also applied filter to list table that takes into consideration the value of parameter. Because "select state" value is not present in list table, nothing is displayed. Good so far. After user enters correct state values and presses Enter, list table again shows everything correctly. Now, the problem happens when user clears text input control and presses Enter, then parameter has lost it's default value and all the records are shown but in our case we shouldn't display all records but empty list table.

 

Any suggestions how to achieve this?

 

Rain

1 ACCEPTED SOLUTION

Accepted Solutions
FredrikE
Rhodochrosite | Level 12

HI!

You can use boolean logic in your filter expression, i think I got it with this filter expression:

 

IF ( GetLength('parameter'p) > 0 )

RETURN ( UpCase('searchvar'n) StartsWith UpCase('parameter'p) )

ELSE ( 'searchvar'n StartsWith '###' )

 

Does it work for you?

//Fredrik

View solution in original post

3 REPLIES 3
FredrikE
Rhodochrosite | Level 12

HI!

You can use boolean logic in your filter expression, i think I got it with this filter expression:

 

IF ( GetLength('parameter'p) > 0 )

RETURN ( UpCase('searchvar'n) StartsWith UpCase('parameter'p) )

ELSE ( 'searchvar'n StartsWith '###' )

 

Does it work for you?

//Fredrik

Rain
Obsidian | Level 7

Hi Fredrik.

 

I maybe missed the whole logic from you suggestion but I took this boolean logic and now my filter looks like this:

 

( GetLength('parameter'p) > 0 ) AND ( 'parameter'p = 'County1'n )

 

And this actually did the trick. After clearing text input  box and pressing enter nothing is shown as we wanted.

 

Thank you.

FredrikE
Rhodochrosite | Level 12

Yours is much cleaner, nice!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 1887 views
  • 0 likes
  • 2 in conversation