Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
ed2
Luminary Alumni
Luminary Alumni

Copy/pasting a list of values to search/select in a field

Hi all,

New to the boards here and have a rather specific question. I have some users who would like to be able to copy/paste a list of values from an Excel/etc into Qlik and use them to make selections in a field - i.e. by account number, client ID, etc.

 

I feel like I've gotten much of the way there but some of the pieces are eluding me. Here's what I've done so far:

 

1. Created a variable vSearchInput and added a Qlik variable input object in order to receive the copy/pasted values. When pasted in direct from Excel the line breaks are removed and each values gets fed into the variable with a space in between, i.e. "Value1 Value2 Value3 Value4." I wish the line breaks would stay so I could use them as a delimiter instead of the space, but that doesn't seem to be a possibility.

 

2. Created a variable vSearchString with code "=Trim(Replace('$(vSearchInput)',' ',' | '))" - this replaces the spaces with "|" to turn the input list into a Qlik search string - like 'Value1 | Value2 | Value3 | Value4'.

 

3. Added a Qlik button with the action "Select values matching search string." This is where I'm failing - no matter how I try to add the vSearchString variable as the Value, it doesn't actually select the values. If I enter '$(vSearchString)' as the value this will work as long as I enter only one search value into the copy/paste box. But nothing I've tried works once I enter a second value.

 

 

In summary: Anyone have any thoughts on the proper syntax to use with this kind of "|" search string, stored in a variable, then used to drive the search action on a Qlik button? Thanks in advance for taking a look!

1 Solution

Accepted Solutions
marcus_sommer

In the end your search-values need to be to look like:

(Value1|Value2|Value3|Value4)

and if the values contain spaces or special chars you need to additionally wrap the values with quotes. like:

("Value1"|"Value2"|"Value3"|"Value4")

- Marcus

 

View solution in original post

3 Replies
marcus_sommer

In the end your search-values need to be to look like:

(Value1|Value2|Value3|Value4)

and if the values contain spaces or special chars you need to additionally wrap the values with quotes. like:

("Value1"|"Value2"|"Value3"|"Value4")

- Marcus

 

ed2
Luminary Alumni
Luminary Alumni
Author

Thank you Marcus, that pointed me in the right direction. I tweaked my search string variable to add the parantheses and the quote marks, and everything works beautifully now. Thanks again!

qlikster
Contributor III
Contributor III

Hi Ed2,

any possibility to share the full solution since I'm facing the same problem :).

I've been able to do this in Qlikview before but not in Sense.