Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
woshua5550
Creator III
Creator III

Concatenate field value with single quotes

Hi there

let's say I have a table like this

F1

A

B

C

need a expression in text box to show this result

'A','B','C'

how to do this ? thanks

1 Solution

Accepted Solutions
Or
MVP
MVP

Fun with chr(39)

=chr(39) & concat(F1,chr(39)&','&chr(39)) & chr(39)

View solution in original post

18 Replies
Or
MVP
MVP

Fun with chr(39)

=chr(39) & concat(F1,chr(39)&','&chr(39)) & chr(39)

sunny_talwar

Or this

Concat(DISTINCT Chr(39) & F1 & Chr(39), ', ')

woshua5550
Creator III
Creator III
Author

Nice ! thanks a lot

but there is no Escape Character in qlik expression syntax ?

sunny_talwar

There is, check this

Escape sequences

woshua5550
Creator III
Creator III
Author

Neat one !

woshua5550
Creator III
Creator III
Author

Love it

sunny_talwar

I think this should work

Concat(DISTINCT '''' & F1 & '''', ', ')

Here I have used four single quotes

woshua5550
Creator III
Creator III
Author

Hi Sunny

Actually it not , I find that we have to put a space after first single quote so that expression syntax will be ok

like this

Concat( ' ''' & F1 & ' ''', ',')

but we will have spaces in result   weird

sunny_talwar

But why do you want to put spaces after first single quote? Why not this?

Concat(DISTINCT '''' & F1 & '''', ', ')