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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Bo_PT
Contributor III
Contributor III

Qlikview script relative path syntax

Hi, On our Qlikview server, the source_documents folder structure is something like this:
 
- Source_documents
  - Project_A
     - 1_resource
     - 2_include
     - 3_QVDGenerator
     - 4_QVD
     - 5_Application
 
We have a qvw which is located under the '3_QVDGenerator' subfolder and we have a DBinfo.qvs located under the '2_include' subfolder. The qvw has this line in its script:
 
$(Must_Include=' \..\..\2_include\DBinfo.qvs'); 
 
The qvw works well but I don't understand why. I know syntax like '..\' will go up to the 'Project_A' parent folder, right? What does '\..\..\' do here?
 
Thanks
Labels (1)
1 Solution

Accepted Solutions
marksouzacosta

That is funny...
I was using Must_Include without space before the first \:
$(Must_Include='\..\..\2_include\DBInfo.qvs'); 

Now I see you have a space before. I have added the space and it worked:
$(Must_Include=' \..\..\2_include\DBInfo.qvs');

The first one renders as:
$(MUST_INCLUDE= ***. E:\..\..\2_include\DBInfo.qvs file not found.

My guess is, space + \..\ just gets ignored by Qlik. It does not mean anything. It is - awkwardly - the same as: $(Must_Include='..\2_include\DBInfo.qvs');

To prove my point, I moved the QVD Generator a another subfolder and I have used the following and it worked:
$(Must_Include=' \..\..\..\2_include\DBInfo.qvs');

So, \..\ is ignored and Qlik moves up two folder levels to find the DBinfo.qvs.

At the end I think you just found a bug. I would recommend removing the extras \..\ and keep as:
$(Must_Include='..\2_include\DBInfo.qvs');

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

View solution in original post

8 Replies
marksouzacosta

The \ at the beginning means the root directory.
So if I do something like $(Must_Include='\AnotherInclude.qvs); I'm telling Qlik to go to the root directory and find the AnotherInclude.qvs file.

I tried to simulate the $(Must_Include=' \..\..\2_include\DBinfo.qvs'); exactly like you did and in my Windows 11 it did not work at all. Do you have a DIRECTORY statement somewhere in your Load Script or any other Include Statement?

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Bo_PT
Contributor III
Contributor III
Author

HI Marksouzacosta Thanks for your reply. Do you mean the root directory of the drive (like D:\ drive) or the root directory of QDS (Soource_Documents)? 

Bo_PT
Contributor III
Contributor III
Author

I just found there is a mistake in my original post. There is another subfolder level in our folder structure. It is actually like this:

- 😧 \Source_documents
  - Department_A
    - Project_A
      - 1_resource
     - 2_include
     - 3_QVDGenerator
     - 4_QVD
     - 5_Application

So if \ goes up to the D:\Source_documents folder, each ..\ goes one level down. Then it might explain. Is it how it works?

marksouzacosta

The Drive, directory D:\

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

marksouzacosta

I tried that too, adding another level but in my case, it hasn't worked too. I think something else is affecting the folder. Can you please share your QVW or your Load Script?

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com

Bo_PT
Contributor III
Contributor III
Author

folder.png shows the folder structure on Qlikview server.
script.png shows the Qlikview app (qvf) script.

Bo_PT
Contributor III
Contributor III
Author

I made 3 simplified files. See attachments: FolderTest.qvf, DBCredential.qvs, ExternalDataPath.txt.

marksouzacosta

That is funny...
I was using Must_Include without space before the first \:
$(Must_Include='\..\..\2_include\DBInfo.qvs'); 

Now I see you have a space before. I have added the space and it worked:
$(Must_Include=' \..\..\2_include\DBInfo.qvs');

The first one renders as:
$(MUST_INCLUDE= ***. E:\..\..\2_include\DBInfo.qvs file not found.

My guess is, space + \..\ just gets ignored by Qlik. It does not mean anything. It is - awkwardly - the same as: $(Must_Include='..\2_include\DBInfo.qvs');

To prove my point, I moved the QVD Generator a another subfolder and I have used the following and it worked:
$(Must_Include=' \..\..\..\2_include\DBInfo.qvs');

So, \..\ is ignored and Qlik moves up two folder levels to find the DBinfo.qvs.

At the end I think you just found a bug. I would recommend removing the extras \..\ and keep as:
$(Must_Include='..\2_include\DBInfo.qvs');

Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com