Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading Excel file with data in Qlikview automatically

Hi everyone,

I have developed a qlikview app where in the data is in excel files for each month. Excel file of each month is loaded in the app seperately.

Is there a way the app pulls the new excel file that is generated each month when the excel file is dumped in the server?. I heard that there is a code that goes into the load script using a WILDCARD function. Not sure if its true.

The only other solution is to manually load the new excel file of that month into Qlikview app which is not what I am looking for.

Can I get some help on this please.

Regards,

Koushik.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Yes, it should be possible to load the different files using a wildcard in the file name.

If you excel files have same structure, say two fields FIELDA, FIELDB, and your files are named like DATA_201212,

then you would load 1 file like

LOAD

     FIELDA,

     FIELDB

FROM

[DATA_201212.xls]

(biff, embedded labels, table is Sheet1$);

Then use a wildcard (asterisk) to load all excel files matching the file name in the working directory:

LOAD

     FIELDA,

     FIELDB

FROM

[DATA_*.xls]

(biff, embedded labels, table is Sheet1$);

View solution in original post

6 Replies
swuehl
MVP
MVP

Yes, it should be possible to load the different files using a wildcard in the file name.

If you excel files have same structure, say two fields FIELDA, FIELDB, and your files are named like DATA_201212,

then you would load 1 file like

LOAD

     FIELDA,

     FIELDB

FROM

[DATA_201212.xls]

(biff, embedded labels, table is Sheet1$);

Then use a wildcard (asterisk) to load all excel files matching the file name in the working directory:

LOAD

     FIELDA,

     FIELDB

FROM

[DATA_*.xls]

(biff, embedded labels, table is Sheet1$);

Not applicable
Author

The structure is the same but the names are different.

Example: In the app. I got the excel data from jan to dec 2011 and they are named as Data_Jan_2011 , Data_feb_2011 and so on. I have loaded them seperately. I cant merge all of them.

swuehl
MVP
MVP

Have you tried something like

[Data*.xls]

as file name in your LOAD statement? I am not sure what you mean with: I can't merge all of them.

Not applicable
Author

Thanks Swuehl.

What I meant was. The data is in seperate excel sheets for each month with file names Data_jan_2011, Data_Feb_2011 untill December and have loaded them individually rather than merging all the excel files into one and loading it.

Not applicable
Author

Hi,

You may try a loop

declare a variable like

ShName = 'jan_2011', 'feb-2011'....  (you can even do it autimatically with month and year based from a start to an end, that makes it automatocally dynamic).

then create a loop

FOR EACH v IN ShName

DO

LOAD  ...... FROM  YourFile.xls (biff, embedded labels, table is $(v)$;

NEXT

best regards

christian

AbhijitBansode
Specialist
Specialist

[Data*.xls] will work perfectly even if u have separate excel file with the naming convention u have specified.