Discussion Board for collaboration related to QlikView App Development.
I'd like to import an excel file which got many excel sheets. All excel sheets got the same data structur. But i don't know how many sheets are in the file. I think I need a command that imports all sheets.
Did anybody know a command like that?
Solved! Go to Solution.
Now I've got another problem. The script only checks, how many sheets the first excel file got, but in the folder are a lot of excel files. Maybe the first file only got tewnty sheets and the second file got thirty sheet. Now only the first 20 charts are included in qlikview.
How could I edit this script for more files?
ODBC CONNECT TO [Excel-Dateien;DBQ=C:\Page\nm.xls];
FOR i = 0 to NoOfRows('tables')-1
LET sheetName = purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39));
LOAD @1 as Uhrzeit,
@2 as UU,
@3 as Datum,
Date(@3) as %KeyDatum,
FROM C:\Page\* (biff, no labels, table is [$(sheetName)]);
You need to embed this script into another loops, which goes through all files. Filename then must be handed over into a variable. So script might be somehow:
FOR EACH vFile IN FILELIST ('YourDirectory\*.xls')
ODBC CONNECT TO [Excel-Dateien;DBQ=$(vFile)];