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: 
lucarizziero
Partner - Contributor III
Partner - Contributor III

$ (dollar symbol) inside a variable script

Hello,

Inside the load script I need to use a variable containing an absolute path with a $ dollar symbol: it not runs, I think the problem is Qlik interprets it as a special symbol for returning a variable value.

For instance I try to run:

SET myvar = '\\server\datafiles$\qdstorage";

STORE mytable INTO $(myvar)\mytable.qvd;

no error is returned, but the script stop there.

Is there a way to mask the $ symbol in order to use it inside a string variable ?

Any other suggestion ?

Thanks for helping people.

4 Replies
Not applicable

I'm not sure if its a typo but you are quoting the SET with a single quote and end it with a double?

If it is just a typo, how about using chr(36) which is ASCII decimal for the $ sign? Perhaps:

SET myvar = '\\server\datafiles' & chr(36) & '\qdstorage';

STORE mytable INTO $(myvar)\mytable.qvd;

Regards,

Gordon

chriscammers
Partner - Specialist
Partner - Specialist

Looks like you have a syntax error totally unrelated to the $

you have a double quote " at the end of the string. Replace it with a single quote ' 

lucarizziero
Partner - Contributor III
Partner - Contributor III
Author

Hi

I correct it:

SET myvar = '\\server\datafiles$\qdstorage';

STORE mytable INTO $(myvar)\mytable.qvd;

but the result is the same,

If I try:

STORE mytable INTO c:\server\datafile\qdstorage\mytable.qvd;

it runs correctly

swuehl
MVP
MVP

If I put your code snippet in a script an debug, it seems that your variable is correctly placed in:

STORE mytable INTO \\server\datafiles$\qdstorage\mytable.qvd

(so I don't see a problem with variable evaluation here):

Is this path really a valid path in your system? What if you just try the hardcoded full path like above? Does this work then?