Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
MVP & Luminary
MVP & Luminary

Re: Concatenate Load all files in Folder

Maybe you need to include the basedir too:

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


talk is cheap, supply exceeds demand
Community Browser