Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How can I create a multi line "SET" statement in script?

I would like to turn a long 1 line SET statement into a manageable 2 or 3 lines like so:

SET variable = "really really really really really really really really really really really really really really really really really really long variable"

to

SET variable = "really really really really really really really really really really really" &

                       "really really really really really really really long variable"

Is there a way to do this with the SET statement or should I just modify the above to a let statement?

thanks,

rich

Tags (3)
1 Solution

Accepted Solutions
Not applicable

Re: How can I create a multi line "SET" statement in script?

You can have carriage returns in a set statement but they will be included as part of the variable value. For example:

SET variable =really really really really really really really really really

really really really really really really really

really really long variable;

If you need to remove the return characters you can try to use the replace function (I don't know if you need use chr(10), chr(13), or both as the search string to replace).

5 Replies
Not applicable

Re: How can I create a multi line "SET" statement in script?

SET cannot evaluate and LET is used to evaluate.

As you have &, I think you dont have an option,other than making it to LET.

Not applicable

Re: How can I create a multi line "SET" statement in script?

I'm using & as an example as a possible delimiter. I don't what the right delimiter is, (or even if there is one).

I actually don't want to evaluate the string as it is full of formulas and I want it to appear as string literal for a field in a LOAD statement.

Not applicable

Re: How can I create a multi line "SET" statement in script?

Can you give me some more info on your requirement.

Not applicable

Re: How can I create a multi line "SET" statement in script?

You can have carriage returns in a set statement but they will be included as part of the variable value. For example:

SET variable =really really really really really really really really really

really really really really really really really

really really long variable;

If you need to remove the return characters you can try to use the replace function (I don't know if you need use chr(10), chr(13), or both as the search string to replace).

Not applicable

Re: How can I create a multi line "SET" statement in script?

Thanks. This works