Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am using a for loop to load all files in a directory. The file sizes very but some are quite large. I want load just the file name from each file so my script is the below. However even though I am loading just the filename I am still loading all the records in each file which can take a while. Is there a way for me to load just the file name without loading all records in the file?
For Each File in FileList('lib://Qlik Control Data/*.xlsx');
LOAD
FileBaseName() as FileName
FROM ['$(File)']
(ooxml, embedded labels, table is Table1);
Next File
Thanks,
Mark
Try this:
For Each File in FileList('lib://Qlik Control Data/*.xlsx');
LET vFileName = SubField('$(File)','\',-1) ;
LOAD '$(vFileName)' as FileName AutoGenerate 1;
Next File
Try this:
For Each File in FileList('lib://Qlik Control Data/*.xlsx');
LET vFileName = SubField('$(File)','\',-1) ;
LOAD '$(vFileName)' as FileName AutoGenerate 1;
Next File
Hi Gysbert,
According to above script, what exactly the output would be. I havn't fiddled around much, hence the doubt.
No idea, that depends on which files with the .xlsx extension exist in the folder that the data connection Qlik Control Data points to. The file names of those files should end up in a table in the field FileName.