Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use variable from Input box in Match function

Our CRM has a text "Notes" field that can be very large. We want the ability to filter via a user-supplied keyword, so the idea was to create an Input Box where the user entered the search term (stored in vSearch), and I used the MixMatch function as an Expression in the table:

if(MixMatch(Notes,vSearch)>=1,Notes,'No Match')

However, this uniformly returns "No Match", even when I type in the word "The" (which does appear in the Notes frequently!).

I'm guessing it's because vSearch is not a string. I tried MixMatch(Notes,$(vSearch))>=1, but that always returned "No Match" as well.

I'm not sure how to add the quotation marks to make vSearch a literal.

Any assistance would be appreciated!

thanks,

Kevin

Labels (1)
1 Solution

Accepted Solutions
rubenmarin
MVP
MVP

Hi Kevin, MixMatch will look for the whole string, maybe you looking for WildMatch.

For a variable vSearch with the value: Note

This expression returns Found:

=If(WildMatch('Notes','*$(vSearch)*'), 'Found', 'Not Found')

View solution in original post

6 Replies
rubenmarin
MVP
MVP

Hi Kevin, try enclosing the string returned by the variable between quotes:

MixMatch(Notes,'$(vSearch)')

Not applicable
Author

HI Ruben,

I thought of that, but doesn't that tell the system to look for the string $(vSearch) ?

In any case, when I tried it, it returned "No Match" uniformly. Then I thought, why not enter the quote strings in the Input box, so I entered 'Not Qualified' (with the quote marks in the search string) I checked under the "Settings-> Variable Overview' and the value was 'Not Qualified' (with the quotation marks). But the same thing: No match.

Here's the data in "Full Notes" and the result of my expression in "Searched Notes"

match.JPG

Not applicable
Author

Now I'm very confused.. I changed my expression to include the actual value, just to make sure, and even when I entered "if(MixMatch(Notes,'Not Qualified')>=1,Notes,'No Match')" as my expression, it returned "No Match".

Now, quite clearly, we can see "Not Qualified" is present in the "Full Note", so why does the MixMatch function not return a positive value here?

rubenmarin
MVP
MVP

Hi Kevin, MixMatch will look for the whole string, maybe you looking for WildMatch.

For a variable vSearch with the value: Note

This expression returns Found:

=If(WildMatch('Notes','*$(vSearch)*'), 'Found', 'Not Found')

Not applicable
Author

Thanks, Ruben, changing to Wildmatch and adding the "*" delimiters did the trick!

Shubham_Deshmukh
Specialist
Specialist

That's great, worked for me.