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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rwunderlich
MVP
MVP

String List expression

Can anyone come up with an expression (no script solutions) to convert this list:

    A, B C,   D

into

    'A','B C','D'

This kinda works:

=chr(39) & replace(mytext',',', chr(39) & ',' & chr(39)) & chr(39)

Except it doesn't remove leading and trailing spaces from each element.

Thanks,

Rob

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Not sure if this is the best solution, but I think we need a way to iterate over the substrings and apply a trim.

So I reused something I used for substring removal (posted here:http://community.qlik.com/message/162166)

Please find attached an adaption to your problem.

Regards,

Stefan

View solution in original post

2 Replies
swuehl
Champion III
Champion III

Not sure if this is the best solution, but I think we need a way to iterate over the substrings and apply a trim.

So I reused something I used for substring removal (posted here:http://community.qlik.com/message/162166)

Please find attached an adaption to your problem.

Regards,

Stefan

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     I tried and come up with this using valuelist function.

     =Chr(39)&Concat(Trim(ValueList($(=chr(39) & replace('A, B, C,   D',',', chr(39) & ',' & chr(39)) & chr(39)))), Chr(39) & ',' & Chr(39)) & Chr(39)

Celambarasan