Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Determine Path of Included File

Can anyone think of a way for an script included file to determine what path the include was from? For example, if my script contains:

$(Include=..\foo\bar\myfile.qvs);

Is there any way for the script in myfile.qvs to derive that it was loaded from ..\foo\bar\? Relative or absolute, doesn't matter to me.

Thanks,

Rob

2 Replies
tresesco
MVP
MVP

Hi Rob,

Not sure why you need this. When you are including the file in the script, you already know the path. If you want to refer it in the fron-end, you might use a variable to hold that, or a simple load statement with FilePath(). Am I missing something?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP
Author

Hi Tresco,

As to why I need this. The requirement is for the QVC script library (and other projects) I maintain. It would be useful for the library to be able to reference (as in a LOAD) other files in the same directory. I don't need it in the front end, but in included script. A workaround I've considered is to require the user to set a variable like:

SET Qvc.Path=..\foo\bar\;

$(Include=$(Qvc.Path)myfile.qvs);


Then the "Qvc.Path" variable will give me what I need. But it would be much more elegant if the user was not required to set the Qvc.Path variable.

-Rob