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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate Load all files in Folder

Hello all,

I took a lot of this script from user Henric Cronstrom. It's new to me and not surprisingly, I cannot figure out why it isn't working. I don't get errors in the script, the script runs and there is no data in the .qvw. I am sure the error is that it's not finding any files in the folder. The code is below. All the Files start with 'OM Holds' (no quotes) then have a date such as OM Holds 23May2013.xls. All the files are .xls.

So the code should run through, find a file, load all the fields, then after the first run concatenate load.

Thanks for any help you can provide1

set vBaseDir = 'C:\OM_Holds\';

set vFileBaseName = 'OM Holds';

set vConcat = ;

for each FileExtension in 'xls'

     for each vFile in filelist('$(vFileBaseName)' & '*.' & FileExtension)

        FileList:

        $(vConcat)

          load

                *,'$(vFile)' as SourceFile

          from 

               [$(vFile)] (biff, embedded labels, table is [Export Worksheet$]);

              

               set vConcat = Concatenate;

     next vFile

next FileExtension

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Maybe you need to include the basedir too:

filelist('$(vBaseDir)'&'\'&'$(vFileBaseName)' & '*.' & FileExtension)


talk is cheap, supply exceeds demand