Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

david_ze
New Contributor III

loading multiple excel files

Hi All, I'm loading mutiple excel files with the same tables by using the script below:

For each ExcelFile in filelist ('*.xls')

My_data:

Load * From $(ExcelFile) (biff, embedded labels, header is 1 lines, table is Sheet1$);

Next ExcelFile;

The result of the reload is that Qlikview creates synthetic keys for each filed multiple by the number of files.
I'll appreciate your advice on how to avoid the synthetic keys.
Regards
David

3 Replies
jason_michaelid
Honored Contributor II

loading multiple excel files

Assuming all files are the same and that each file only contains one of each field name (ie no duplicate field names) then:

My_Data:

LOAD

  *

FROM  C:\<path>\*xls...;

That should work.

Hope this helps,

Jason

danielrozental
Honored Contributor II

loading multiple excel files

Try something like

My_data:

Load null() as somefield

autogenerate(0);

For each ExcelFile in filelist ('*.xls')

concatenate(My_data)

Load * From $(ExcelFile) (biff, embedded labels, header is 1 lines, table is Sheet1$);

Next ExcelFile;

drop field somefield;

david_ze
New Contributor III

loading multiple excel files

Thanks Daniel it works fine...
David

Community Browser