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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
hfkchristian
Creator
Creator

Search string for exact match

Hi all

In my data model I have a table with data like this:

IdName
1a
2ab
3abc
4d

Then in my application I have a listbox which displays the field Name.

Now I need a button, and when the user clicks on the button, the name with Id=1 should be selected. The Ids are fixed, but Names may change. So I can't use the value of Name in the search string.

Therefore, in the searh string of the select in field action, I search Name with this expression:

='"'&only({1<ID={1} >} Name)&'"'

Which works for any Id but Id=1. For Id=1, the searh string will become "a", and QlikView will select everything that starts with an a. So it selects both a, ab and abc.

How I can I do this so it only selects values with an exact match?

Also, if someone knows a simpler way to do this then with my only-function, that would be nice too

9 Replies
MK_QSL
MVP
MVP

If you are searching from Id, what result you will get if you use below Search String...

=Only({<Id = {1}>}Name)

sunny_talwar

Try without double quotes:

=Only({1<Id = {1}>} Name)

Seems to be working for me

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I'm not sure but it might have something to do with your selection for Default Search Mode. Check Settings->Document Properties->Presentation->Default Search Mode. Select "Use Normal Search" and try again.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Add two actions to your text box. The first is a Select in Field action that selects 1 in the field Id. The second is a Select Possible action for the field Name. No need for search strings.


talk is cheap, supply exceeds demand
hfkchristian
Creator
Creator
Author

If I don't use double quites, everything gets selected. I think I need to use quotes, because the names may contain spaces?

hfkchristian
Creator
Creator
Author

The search mode under document properties was allready set to normal. Search mode under user preferences was set to fuzzy. I changed that to normal too, but I still get the same result.

hfkchristian
Creator
Creator
Author

This works, but I will actually need three actions for this. First to select the id, then select possible names, and then clear the selected id. I was hoping to do all this with one action. I need a lot of these selections, and trigger actions in QlikView are not presented in a user friendly way.

I wish a could use a macro, but it needs to work in the AJAX client.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You should probably just let users make the selections they need instead of doing all sorts of magic in the background with triggers, actions, macro's and whatnot.


talk is cheap, supply exceeds demand
sunny_talwar

In that case try using this with parenthesis around it with double quotes:

='("' & Only({1<Id = {5}>} Name) & '")'