Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How do I create a variable string that contains single quotes

How do I get the 'Let' assignment to include the quotes surrounding the code values.  There are about 20 values, I use them

in 4 select statements, and do not want to hardcode the 'IN' condition multiple places since the values may change over time.

LET

vActivity_Code_List='''Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS''';


SQL

SELECT

    al.ACTIVITY_CODE,

    al.ACT_LOG_COMMENT,

    al.CONTACT_ID_SEQ,

    al.LAST_MODIFIED_DATE

FROM PROD."ACTIVITY_LOG" al

WHERE 1 = 1
AND   al.ACTIVITY_CODE in ('$(vActivity_Code_List )')


;

1 Solution

Accepted Solutions
Gysbert_Wassenaar

SET vActivity_Code_List='Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS';


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

SET vActivity_Code_List='Appeal_LA','Appeal_BT','Appeal_NU','Appeal_HS';


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I also had to remove the quotes from here: ('$(vActivity_Code_List )') and that worked, thank you!