I have a list of table containing thousand rows of case IDs. I want to search more than 1 case IDs at one go, say 202001 and 202002, so that the table only display this 2 cases for me to compare the entries.
So far I see there are two ways but they are have limitations:
Method 1: link . Based on this previous thread, one way is to parse the inputs into separate terms. How does one do that? Even so, this method is not scalable; it's hard to say how many search terms the user may entered at any point in time.
Method 2: I added a Prompt container at the report section. Added 2 text input boxes in it. However, when I entered 202001 in the first box, and entered 202002 in the second box, the list table did not show the results as expected. Any idea why this did not work? Anyway,this method is also not scalable.
Any ideas for a scalable and "flexible" approach to searching multiple terms in SAS VA?
Sounds like a wildcard approach would give you the greatest flexibility.
You could use one search box and have your users either type the entire string, or if they want to see a range of cases, then use wildcards.
Have a read here for how to implement:
Doing this with 2 search boxes would provide even greater flexibility (but with the cost of increased logic).
Thanks for the reply. Interesting link there you have provided. However, this "wildcard" solution seemed applicable only for words. For example if you entered "cat", then the results would show " Catherine", "Catie" etc. But my search queries are now numeric in nature; case IDs like 2020xxxxx01, 2020xxxxx02.
So when user search the two case IDs, or three, or four or more, the list table should only show the case IDs queried. Any ideas?
Yes Matt, simply change the variable type of case_id from numeric to character.
If it is vital that case_id stays numeric (for other parts of the report), then just take a copy of it instead and change the copied variable's type to character, for use just on the pages where you want to search.
Once you have a character variable, this will work perfectly for you, I had the same thing running at my previous job.
Hi Jim. But how should the user entered the queries? If there was only one text input box, should user enter "2020xxxxx01 ; 2020xxxxx02" in it? Would SAS VA automatically recognize the delimiter ";" in the text input box, and recognized two terms? What is the best way to enter multiple terms?
If you implement as per the link, but use "Begin" in stead of "Contains", I would then advise users to search by typing, 20200, for example.
This should then filter for 202001, 202002, 202003... 202009
If you had another search box implemented in the same way, you could do "searchbox1" or "searchbox2", allowing them to get two exact case_id, or one or two case_id ranges.
Hi Jim. What if the user already know the exact case IDs, and just want to extract the details of them in the list table? (Hence no need for an range of results) Say the case IDs are 202001, 201901 and 201801. Is there a way to do so in a single search box? Or I would need three search boxes? The idea is to allow flexibility in the number of search terms, without being restricted by the number of search boxes.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.