Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Copy and Paste Function

Good day everyone,

I have the following data set:

Customer_IDName
C_1AA
C_2BB
C_3CC
C_4DD
.......
C_999YY
C_1000ZZ

My idea is to create an input box (variable: vSearch) and a button such the user can copy customer IDs from an Excel spreadsheet and paste it into the input box to view specific customer IDs, but I assume there is some form of formatting required in order to this.

I've tried the following:

  • Button Properties
    • Actions
      • Select in Field
        • Field: CUSTOMER_ID
        • Search String: ='('&replace(trim(replace(vSearch,',',' ') ),' ','|')&')'

But I'm not getting any results from this methodology - any other ideas?

Thanks!

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I've used this to copy directly from Excel a list of values.  Paste them into an input box that is tied to a variable like your vSearch. 

='('&replace(replace(replace(replace(replace(trim(vSearch),chr(10),'|'),',','|'),' ','|'),'|||','|'),'||','|')&')'

Then I use an action tied to a button to apply the search.

View solution in original post

5 Replies
shun_wong
Partner - Contributor III
Partner - Contributor III

Hi Marnitz,

You are nearly there with the Pipe, but the syntax for multiple selections for triggers are:

("C_1"|"C_2"|"C_3") etc...

So you will need to add in double quotes for wrapping against each customer ID.

Maybe something like this: (NOT TESTED!)

='("'&trim(replace(trim(vSearch),', ','"|" ') )&'")'

Anonymous
Not applicable
Author

I've used this to copy directly from Excel a list of values.  Paste them into an input box that is tied to a variable like your vSearch. 

='('&replace(replace(replace(replace(replace(trim(vSearch),chr(10),'|'),',','|'),' ','|'),'|||','|'),'||','|')&')'

Then I use an action tied to a button to apply the search.

Anonymous
Not applicable
Author

I should explain that it is also considering any spaces,commas, or chr(10) as possible delimiters for individual values.  So it may be more than you want.

The chr(10) is what the delimiter is when copying a column of values from Excel.

Not applicable
Author

Hi Shun Wong, thank you for the suggestion, the syntax did work for a single line of text but had trouble with multiple line string (Excel paste).

Not applicable
Author

You Sir, are a genius!

It works perfectly, thank you Wallo for the solution and the reasoning .