Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use a variable value as a string in a Load instruction ?

Hi,

I'm trying to do a simple thing in a script (QlikView Desktop V9):
I've a variable :

SET V_UNKNOW_MARKET='Unknow' ;

then further in the script, I want to use this value :

LOAD
autonumber( [Region] & '/' & $(V_UNKNOW_MARKET)) as KEY
....

So it's quite simple, but with this syntax, QlikView understand the string 'Unknow' as a fieldname : Unknow.
I'm fighting with the syntax (using LET, SET, $(=) ...)

Do you know how to specify that the variable value is a constant string ?

Best regards

Labels (1)
1 Solution

Accepted Solutions
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

The dollar expansion will just replace the string literal in your script. You need to include the quotes for it:

LOAD
autonumber( [Region] & '/' & '$(V_UNKNOW_MARKET)') as KEY

Stephen

View solution in original post

3 Replies
stephencredmond
Partner - Specialist II
Partner - Specialist II

Hi,

The dollar expansion will just replace the string literal in your script. You need to include the quotes for it:

LOAD
autonumber( [Region] & '/' & '$(V_UNKNOW_MARKET)') as KEY

Stephen

d_pranskus
Partner - Creator III
Partner - Creator III

Hi

Use folowing syntax

var = CHR(39) & 'Unknown' & CHR(39)

39 stands for ASCII code for single quote.

Cheers

Darius

Not applicable
Author

Thanks,
both solutions are working

Big Smile

Regards