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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

using variable in path

I've got

Load...

FROM $(vQvdPath) & '\my_QVD_Data_File.QVD'

my variable vQvdPath has: QVD\

I want to be able to change my vQvdPath easily, that's why I used this variable.  What am I doing wrong?

1 Solution

Accepted Solutions
Not applicable
Author

no you can't just add like that and no it's not a bug, only variables created in the script can be used in the script.

glad you found the answer

Joe

View solution in original post

6 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

FROM [$(vQvdPath)\my_QVD_Data_File.QVD] (qvd)


HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks, Jonathan, unfortunately, it doesn't like the square brackets.  I've also tried '[' & $(vQvdPath).

The error is:

Cannot open file 'C:\.....' The filename, directory name, or volume label syntax is incorrect.

Not applicable
Author

Use what Jonathan said just without the \

So:

FROM [$(vQvdPath)my_QVD_Data_File.QVD] (qvd)


as your path has the \ already


Joe

Not applicable
Author

I found the answer. 

It looks like you can't just add a variable to the Variables list.  (ie. in Variables list, click "add)

But you can do this:  SET vQvdPath = QVD\;  <-- it is then added to the Variables list.  Then it's happy.

I'm not sure if it's a bug.

Not applicable
Author

no you can't just add like that and no it's not a bug, only variables created in the script can be used in the script.

glad you found the answer

Joe

Not applicable
Author

Thanks JoeSimmons for clarifying .  I hadn't realised that.