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

Relative Path

Hi guys,

How can we make this relative path?

'\\hbeu.adroot.hsbc\dfsroot\GB002\GDMP\01.GDMP\04. Data Quality\25. Data Quality Metrics & Reporting\98. Reporting\DQ_Qlikview\UAT\Config\KeyFile.txt';

Thanks in advance!

Cheers,

Varun

1 Solution

Accepted Solutions
swuehl
MVP
MVP

'..\' will use the parent folder of the current base folder.  I've only used a single dot '.\'

But only stating the file name should also work:

'KeyFile.txt'

If not, your current base folder is not the one you are assuming, or the file is not located at that place.

View solution in original post

10 Replies
swuehl
MVP
MVP

I am missing the path in your request that you want to use as base for the relative path, i.e. the start pointing of the relative path. Or in other words: "relative path to what"?

varunreddy
Creator III
Creator III
Author

Relative to

'\\hbeu.adroot.hsbc\dfsroot\GB002\GDMP\01.GDMP\04. Data Quality\25. Data Quality Metrics & Reporting\98. Reporting\DQ_Qlikview\UAT\Config

sinanozdemir
Specialist III
Specialist III

If you are asking about making relative paths, then here is how you do it:

Directory \\hbeu.adroot.hsbc\dfsroot\GB002\GDMP\01.GDMP\04. Data Quality\25. Data Quality Metrics & Reporting\98. Reporting\DQ_Qlikview\UAT\Config;

Then in your load script, you can directly put the file name:

LOAD

    *

FROM KeyFile.txt;

Another example is that we can only specify the directory to include upto DQ_Qlikview folder:

Directory \\hbeu.adroot.hsbc\dfsroot\GB002\GDMP\01.GDMP\04. Data Quality\25. Data Quality Metrics & Reporting\98. Reporting\DQ_Qlikview;

In the load script, we put ..\ to move into the next folder:

LOAD

    *

FROM ..\..\KeyFile.txt;



Pretty much ..\ helps you move up and down in the folder hierarchy.

Hope this helps.

swuehl
MVP
MVP

So the file is located within the base folder?

'.\KeyFile.txt'

varunreddy
Creator III
Creator III
Author

Trying something like this. But it is not working

varunreddy
Creator III
Creator III
Author

Trying something like this. But it is not working

LET vKeyFileLocation = '..\KeyFile.txt';

swuehl
MVP
MVP

'..\' will use the parent folder of the current base folder.  I've only used a single dot '.\'

But only stating the file name should also work:

'KeyFile.txt'

If not, your current base folder is not the one you are assuming, or the file is not located at that place.

varunreddy
Creator III
Creator III
Author

Hi Swuehl,

Can you kndly explain this?

IF ISNULL(FileTime('$(vKeyFileLocation)')) = -1 THEN
CALL WriteMessageToLog('Expected Key File is not in the expected Location', '$(vKeyFileLocation)', 'KEY FILE');
LET keyFile_Load_Err = 1;
EXIT SCRIPT;
ENDIF

swuehl
MVP
MVP

FileTime() will return NULL() if the given file does not exist (i.e. is not found in the specified location).

If the file is not found, call the sub routine WriteMessageToLog, set variable keyFile_Load_Err to 1 and exit script.

If the file is found, proceed with the script after ENDIF statement.