Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
Highlighted
atkinsow
Valued Contributor II

Re: Copy and Paste Function

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.

5 Replies
Partner
Partner

Re: Copy and Paste Function

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),', ','"|" ') )&'")'

Highlighted
atkinsow
Valued Contributor II

Re: Copy and Paste Function

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.

atkinsow
Valued Contributor II

Re: Copy and Paste Function

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

Re: Copy and Paste Function

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

Re: Copy and Paste Function

You Sir, are a genius!

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