Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set multiline variable

I have a variable splitted as multiline:

SET varList =  "One", "Two", "Three",

                        "Four", "Five", "Six";

Is it the best way to do it?

4 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Any reason you want this to split into multiple lines.

Above works fine, but if you place this variable in text box it wont be centered perfectly. or you can try below to center perfectly.

let varList =  '"One", "Two", "Three",'&chr(10)&'"Four", "Five", "Six"';

Not applicable
Author

I need to split into multiple lines because the line is too long.

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Ok. Both expressions will work. you can use your SET or LET statement that i have provided.

Not applicable
Author

I use this variable to contain the columns to be loaded from an excel. If I use chr(10) then it cause some weird behaviour in my table, first rows inserted contains the header columns, so I solve it by replacing chr(10) and chr(13) from the string variable as below:

LET varList = REPLACE(REPLACE(varList,CHAR(10),''),CHAR(13),''))