Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
shashipraband
Contributor
Contributor

Load data from multiple excel files which has different excel sheets

Hi Experts,

I have to load multiple excel files which has multiple excel sheets with different names. And we have to load specific sheets only from the workbooks (if there are four sheets present in a file we may be required to load only 2 sheets). The sheets which we are picking are having same number of fields and same name

I checked for the solution in the community but they are not working.  Solutions provided by using ODBC or OLEDB connection but it is throwing an error. Connector connect error: SQL##f - SqlState: IM002, ErrorCode: 0.

I am using QlikView personal edition. Version: 12.30.20000.0

Attached are the excel files for the reference.

Could anybody please help me to resolve this issue

 

Regards

Shashi

Labels (1)
1 Reply
sultanam
Contributor III
Contributor III

Hi Shashi,

 

you can use below code as it loaded successfully for me.

ODBC CONNECT TO [Excel Files;DBQ=C:\Users\MD20014506\Desktop\Test10.xls];


ExcelTables:
SQLTABLES;
DISCONNECT;

For i=0 to (NoOfRows('ExcelTables')-1)

Let vSheet=Peek('TABLE_NAME',i,'ExcelTables');

if '$(vSheet)'='A$' or '$(vSheet)'='B$' then

LOAD Brand,
Tower,
Application
FROM
[C:\Users\MD20014506\Desktop\Test10.xls]
(biff, embedded labels, table is $(vSheet));


ENDIF;

Next

 

Regards,
Sultan