Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
azimabadi
Creator III
Creator III

How to qualify a String?

Hi all,

i have a string field, let's assume 'Name':

Name         Age
----------------------

Tobias      20

Richard     23

i wnat to use the concatenated Names in FOR...EACH...NEXT control.

my code looks like :

LOAD concat( Name , ',' ) as conNames

FROM ......

LET ConNames = Peek( 'conNames' );

result is :

     Tobias,Richard

but this doesn't work in FOR...EACH. i need something like:

'Tobias','Richard'

i tried :

LOAD concat( '''' & Name & '''' , ',' ) as conNames

but it doesn't work and i get error when runing script. i need a way to qualify the string value of Name with '.

Thank you all

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try using Chr() function like below

    

LOAD chr(39) & concat( Name , Chr(39)& ','  chr(39)) & chr(39) as conNames

FROM ......

Celambarasan

azimabadi
Creator III
Creator III
Author

thank you so much for advise,

i think the answer is :

LOAD concat( chr(39) & Name & Chr(39) , ',' ) as conNames

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Yes.You can use like that also.

Celambarasan

Miguel_Angel_Baeyens

Hi,

Even when the expression editor does not recognize the Chr() after the comma as second parameter, is likewise valid, and the following expression should work in any object or variable:

LOAD Chr(39) & Concat(Name, Chr(39) & Chr(44) & Chr(39)) & Chr(39) AS conNames

conNames should store now something like

'Peter','Mike','Anthony'

Hope that helps.

Miguel