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

Load from Wildcard filename & extension/filetype

Howdy,

i'm trying to let my load script load from a wildcard file name and filetype.

What is wrong with this script? keeps failing...

TestData:

Load

orderNo,

CustomerNo,

Date

From

;

The problem is, is that sometimes there will be NO files in this directory...and i just want it to return nothing if that's the case. Though if there are files...i want the script to run.

Much thanks!

-David

4 Replies
chrismarlow
Not applicable

Re: Load from Wildcard filename & extension/filetype

This would skip if there are no files,

For each file in filelist('D:\Apps2\CUSTOMER\VendorOrder\$(vNewestFolder)\*.*')

TestData:
Load
orderNo,
CustomerNo,
Date
From [$(file)];

Next

But do you need an empty table if there are no files (as there would not be one created as the middle bit would never be called)?

mov
Not applicable

Re: Load from Wildcard filename & extension/filetype

It is possible to create empty table before loading from files:

TestData:

LOAD * INLINE [

oderNo, CustomerNo, Date];

For each file in filelist('D:\Apps2\CUSTOMER\VendorOrder\$(vNewestFolder)\*.*')
Concatenate(TestData)
Load
orderNo,
CustomerNo,
Date
From [$(file)];
Next

Not applicable

Re: Load from Wildcard filename & extension/filetype

In my production enviroment it's just for a mapping table, that I'm ok with not having any data ...just need the script to say if there are no files - we're all good keep going

Not applicable

Re: Load from Wildcard filename & extension/filetype

How would i do it so it loads an empty mapping table??