Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Aara
Contributor
Contributor

Use WildMatch function for a user defined variable

Hello,

I have a Input Box where User can search for values. User enters the values as a comma separated values.  I also have a Apply selection Button and a Straight table to display all the values used in Filter. When the User searches for a string with only prefix it should return all the values starting with the prefix.

For Example, if the values available are "ABC123","DEF456","ABC6678","ABC3456","DEF2212""BGF0987".

If the user enters value as  "ABC,BGF" in Input and click on Apply selection, the straight table should display all records with values "ABC123","ABC6678","ABC3456" and "BGF0987".

This Input Box values are stored to a variable. Apply Filter button uses this variable.

='('&replace(vMultiselect,',','|')&')'.

This above condition works when the entire value is passed. i.e "BGF0987". But not when "BGF" is alone passed. How to use WildMatch function for this. 

Labels (2)
1 Solution

Accepted Solutions
MarcoWedel

you could also change your search string expression into:

='("'&Replace(vMultiselect,',','*"|"')&'*")'

 

MarcoWedel_0-1651777942055.png

 

hope this helps

Marco

View solution in original post

3 Replies
marcus_sommer

If your real data are exactly like in your example you may adjust your existing logic like:

='('&replace(replace(purgechar(vMultiselect, '0123456789'),'",', '"*,'),',','|')&')'

But if the values couldn't be "cleaned" with such simple rules it could become quite hard to develop stable solutions especially if also the number of search-keys and their length could be differently.

IMO better would be to add an appropriate field to the data-model and the users select the prefix-values directly and/or the users apply the valid search-string directly to the list-box. An input-box + variables + any actions aren't mandatory needed to enable such views and are quite often also not an improvement to usability in regard to an easier access and understanding what's happens (rather the opposite).

- Marcus

MarcoWedel

you could also change your search string expression into:

='("'&Replace(vMultiselect,',','*"|"')&'*")'

 

MarcoWedel_0-1651777942055.png

 

hope this helps

Marco

Aara
Contributor
Contributor
Author

It worked.. Thanks a lot!!!