Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Path Variables

Looking for sample code that "sets" path variables vs. hard-coding path vars...then when testing... have to manually reset. Would rather set PATH vars in the "MAIN" sheet once 🙂 . Please advise.

---- Stephanie Lind

4 Replies
boorgura
Specialist
Specialist

Hey Stephanie,

were you trying to assign paths to variables and use them in the script?

I'm not sure what you are looking for. if that is the case, you can create variables as-

LET PathName = 'C:\abc\def\';

Using it in script will be:

LOAD * from $(PathName)filename.qvd (qvd);

Not sure, if you were looking for this!!!

Not applicable
Author

Hi Rocky,

yep, that's exactly what I'm trying to do...

Which way is better: SET or LET... ?

Also, I have brackets in my code... and it seems to be running fine...do I need them?

Here is my code:

SET TestDir = "E:\Program Files\QlikView\Pinnacle Insight\PI Config Files\Test Apps\";

Store MCATestingData into [$(TestDir)MCATestingData.qvd] (qvd);

Thx in advance for your help 🙂

boorgura
Specialist
Specialist

Hey Stephanie, if you are talking about the brackets '[' in

Store MCATestingData into [$(TestDir)MCATestingData.qvd] (qvd);

They are only necessary if you spaces or special characters in the file name or path used.

Lets say -

Store MCATestingData into [$(TestDir)MCA Testing Data.qvd] (qvd);

will give an error if you remove the '[' and ']'

Not applicable
Author

that's right, I forgot. Thanks so much again... 🙂