Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
In my data model I have a table with data like this:
Id | Name |
---|---|
1 | a |
2 | ab |
3 | abc |
4 | d |
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
If you are searching from Id, what result you will get if you use below Search String...
=Only({<Id = {1}>}Name)
Try without double quotes:
=Only({1<Id = {1}>} Name)
Seems to be working for me
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.
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.
If I don't use double quites, everything gets selected. I think I need to use quotes, because the names may contain spaces?
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.
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.
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.
In that case try using this with parenthesis around it with double quotes:
='("' & Only({1<Id = {5}>} Name) & '")'