Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ramcena306
Creator II
Creator II

How to Write Script to Load Files with Timestamp Filenames

A folder contains multiple fields of the format 'CustmerDetails_YYYYMMDDHHMMSS.xlx'.

The YYYYMMDDHHMMSS part is the timestamp at which the file is generated. Files are generated in the folder every hour. Hence new files are constantly added in the folder, But with different Names.

How can i write the script to load all the files in the folder, into Qlikview application.

4 Replies
Anil_Babu_Samineni

May be this?

Load * From CustomerDetails_*.xls;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
its_anandrjs

Try with attached file

Or you can try this as well as

LOAD

*,FileBaseName() as FileName

FROM

[CustmerDetails*.xlx]

(biff, no labels, table is [*$]);

its_anandrjs

And another one also for loading all excel files.

LOAD *,FileBaseName() as FileName  FROM

[CustmerDetails_*.xlsx]

(ooxml, embedded labels, table is [$(sheetName)]);

MarcoWedel

Hi,

to extract the filename timestamp into a new field, you could add to your load something like:

Timestamp(Timestamp#(SubField(FileBaseName(),'_',-1),'YYYYMMDDhhmmss')) as FileTimestamp


hope this helps


regards


Marco