Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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.