Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Master II
Master II

Re: Loading numerous weekly flat files

Then you may use FILELIST():

FOR EACH sFile IN FILELIST(MyFileSpecification)

     IF WILDMATCH ('$(sFile)', '*2015*', '*2016*') THEN

          LOAD ...... FROM $(sFile);

     END IF

NEXT sFile

Peter

edit: Wildcards added

Highlighted
Creator
Creator

Re: Loading numerous weekly flat files

Where do i declare the location of the qvd?

Highlighted
Master II
Master II

Re: Loading numerous weekly flat files

You may do it in the FILELIST, e.g.

FOR EACH sFile IN FILELIST('C:\TEMP\MyQVD*.QVD')

....

Else you may use a variable (inputbox or via script):

LET sFilePattern = 'C:\TEMP\MyQVD*.QVD';

....

FOR EACH sFile IN FILELIST('$(sFilePattern)')

....

Rgds Peter

Highlighted
Creator
Creator

Re: Loading numerous weekly flat files

Amazing thank you!!!

Highlighted
Contributor III
Contributor III

Re: Loading numerous weekly flat files

Marcus,

Sorry for the thread resurrection. Is there a way to get these concatenated when loading this way?

Highlighted
MVP & Luminary
MVP & Luminary

Re: Loading numerous weekly flat files

As far as the table-structure is the same all files will be automatically concatenated. To ensure this you need to specify all needed fields instead of using a wildcard like: load * from ... so that no new field could disrupt your load-logic. If new fields should be included or there are some missing you need an explicit concatenate(Table) statement - created by a conditionally statement or even fix to an empty table like:

dummy: load 'dummy' as dummy autogenerate 0;

concatenate(dummy)

load YourLoadStuff ...

drop fields dummy;

- Marcus