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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using spaces in the Search String mask for multiple selections

I'm trying to create a trigger that will select certain values in one field based on the selections made by the user in another field.

I've got it working except for one thing - I can't get the search mask to work on the second field when the values contain spaces.

The general format for a search string mask is (ValueA|ValueB|ValueC). That works fine.

However, if any of the values have spaces (Value A|Value B|Value C) , the search mask doesn't seem to work.

See attached QVW for a working example.

Does anyone know how to make a search string mask work when the values contain spaces?

1 Solution

Accepted Solutions
Not applicable
Author

Wierd. I'm surprised quotes doesn't work, but I tried them all. I found a workaround. Change your search string variable to:

'(ALL|' & Replace(only(Field1), ' ', '?') & ')'


All spaces will be replaced by questions marks, which mean any character. That might not work in all situations, but I couldn't find anything better.

Also, you could probably do this as Select in Field: ALL then ToggleSelect: only(field1)

View solution in original post

4 Replies
Not applicable
Author

Wierd. I'm surprised quotes doesn't work, but I tried them all. I found a workaround. Change your search string variable to:

'(ALL|' & Replace(only(Field1), ' ', '?') & ')'


All spaces will be replaced by questions marks, which mean any character. That might not work in all situations, but I couldn't find anything better.

Also, you could probably do this as Select in Field: ALL then ToggleSelect: only(field1)

Not applicable
Author

Awesome. Thanks! The question mark replacement worked great.

I couldn't get the ToggleSelect to work, though...

Not applicable
Author

For the ToggleSelect, you would need: =only(Field1)

I think I forgot the equals sign and used a lower case f in my example. Here is the application using ToggleSelect instead of the Search String.

Not applicable
Author

Got it. Thanks!