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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Including source file name as a field in the import script

Hi all,
I am importing from several source files, so to import from all of them in one go I'm doing something like:


LOAD @1:6 as HDR,
@7:11 as Comp,
@12:22 as [Doc Number],
@23:27 as Year
FROM


However, what I'd really like to do is include the file name as a field in the script. So something like:

For Each file in D:\QlikView\Sourcefiles\
vFilename = file.name
LOAD @1:6 as HDR,
@7:11 as Comp,
@12:22 as [Doc Number],
@23:27 as Year,
vFilename as FileName
FROM

Next

I'm guessing this isn't possible how I've written it, but does anyone know a way I can do this?
Many thanks,
Tony

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

If i understood your question, below is the code for you problem

LOAD @1:6 as HDR,
@7:11 as Comp,
@12:22 as [Doc Number],
@23:27 as Year,
filebasename() as FileName
FROM

Hope this will help you.

- Sridhar

View solution in original post

2 Replies
Not applicable
Author

Hi,

If i understood your question, below is the code for you problem

LOAD @1:6 as HDR,
@7:11 as Comp,
@12:22 as [Doc Number],
@23:27 as Year,
filebasename() as FileName
FROM

Hope this will help you.

- Sridhar

Not applicable
Author

Thanks Sridhar, that's perfect.

cheers,

Tony