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

Relative and Absolute Path

How do I print the absolute path from the relative path in the document?

e.g. If I have source text files in, LET vFilePath=..\..\..\IMS\Source\*.txt

Then I need to print the absolute path of my source file directory.

2 Replies
Nicole-Smith

Is this what you're looking for?

filepath()

Returns a string containing the full path to the table file currently being read.

Example:

Load *, filepath( ) as X from

C:\UserFiles\abc.txt

Will return 'C:\UserFiles\abc.txt' in field X in each record read.

maxgro
MVP
MVP

replace text in bold with your file

LET vFilePath='.\tmp\S.qvd';

load distinct FileDir() as MyFile FROM $(vFilePath) (qvd);

LET vFullFileDir = peek('MyFile');

TRACE $(vFullFileDir);

RESULT

Characters << AUTOGENERATE(26) 26 lines fetched

ASCII << AUTOGENERATE(255) 191 lines fetched

Transactions << AUTOGENERATE(1000) 2.011 lines fetched

S 19 lines fetched

C:\Users\mgrossi\Desktop\tmp