Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
matthewjbryant
Contributor II

Using FileName() without loading all data

I have a folder of daily Open Order extracts in QVD format. The files are named D_OO_YYYYDD. I want to create a table of all dates that are accounted for.

I could Load FileName() From D_OO_*.qvd, but then all the data is ran through for each QVD. Is there a better way?

1 Solution

Accepted Solutions
michielvandegoo
Valued Contributor

Re: Using FileName() without loading all data

Yes:

for each vFile in FileList('your path\*.qvd')

load

     '$(vFile)' as Filelistnames

autogenerate(1);

next vFile

6 Replies
michielvandegoo
Valued Contributor

Re: Using FileName() without loading all data

Yes:

for each vFile in FileList('your path\*.qvd')

load

     '$(vFile)' as Filelistnames

autogenerate(1);

next vFile

MVP
MVP

Re: Using FileName() without loading all data

Try First option

Data:

First 10

Load FileName() From D_OO_*.qvd;


Data:

Load FileName() From D_OO_*.qvd

WHERE RecNo() = 1;


Hope this helps you.



MVP
MVP

Re: Using FileName() without loading all data

Hi,

This is working for me

Data:

First 1

Load FileName()

From D_OO_*.qvd (qvd);

OR

Data:

Load FileName() From D_OO_*.qvd

WHERE RecNo() = 1;


Both are working, but first one is faster.


Regards,

jagan.

matthewjbryant
Contributor II

Re: Using FileName() without loading all data

I thought there had to be a loop! Thanks

MVP
MVP

Re: Using FileName() without loading all data

Looping will take more time.  Instead use First N option.  It is faster.

Regards,

Jagan.

matthewjbryant
Contributor II

Re: Using FileName() without loading all data

I've just tried it, but I'm finding the loop much quicker. Maybe it's because the data is stored on a networked drive and not my local PC.

Edit: Logically though, it makes more sense that the loop would be quicker as it just has to look at the file names, which it has to do anyway to load the data.

Community Browser