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

18 Replies
woshua5550
Creator III
Creator III
Author

it says expression error in my side , have you tried ?

sunny_talwar

Checking

sunny_talwar

Yes, you are right, for some reason it doesn't work.... I guess you can remove the space using PurgeChar or replace, but why would you want to do that when you have easier solutions, right?

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

woshua5550
Creator III
Creator III
Author

Haha,just curious


pietapa
Contributor
Contributor

Hello everyone,

I'm facing a similar issue to what was previously discussed, and I've tried the solution suggested, but it hasn't worked for me. My goal is to save a column of data into an array using the Peek function with the structure above, but I'm having trouble with it. Can someone please help me out?

 

BrunPierre
Partner - Master
Partner - Master

Post sample data and desired results.

pietapa
Contributor
Contributor

This Sample should be okay, I guess: 
I have a table like below. 

Name of Customer

Customer1
Customer2
Customer3
......


I would like to create a variable called 'vCustomers' that will contain the following values: 'Customer1', 'Customer2', 'Customer3', and so on. The reason for creating this variable is to use it in a SQL query.

SELECT * FROM (Table in Data Lake) WHERE Name IN (vCustomers);

Prem0212
Creator
Creator

This expression   Concat(DISTINCT Chr(39) & NAME & Chr(39), ', ')  will work for you.

please accept the solution if u liked it.

 

pietapa
Contributor
Contributor

I tried your solution, but I received an empty variable. I am unsure why it did not work.

pietapa_1-1682587609468.png

pietapa_2-1682587660227.png