Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

EvanBarrick
Contributor

Extract File Name and Append to Script

Is it possible within a Qlik Sense script to extract part of the file name from a data file and then append that to the table you are loading in?

 

For example, if the file is named, 'Assets-18ABCJAN12.xlsx', would it be possible to only grab the '18ABCJAN12' and add into the table as a new field? 

1 Solution

Accepted Solutions

Re: Extract File Name and Append to Script

You can definitely do this using the FileBaseName function

LOAD Subfield(FileBaseName(), '-', 2) as FileDetails,
   ...
FROM ....;
1 Reply

Re: Extract File Name and Append to Script

You can definitely do this using the FileBaseName function

LOAD Subfield(FileBaseName(), '-', 2) as FileDetails,
   ...
FROM ....;