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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikuser225
Contributor III
Contributor III

Load data from multiple sheets from single excel file and store each sheet into QVD dynamically

Hello All,

 

I am trying to load data from multiple sheets from single excel file and store each sheet into QVD dynamically.

i am using below code

 

FOR EACH file in FileList('lib://Qlik/*.xlsx');

//In order to get the file information from SQLtables command making use of the ODBC connection format
ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];

tables:
SQLtables;
DISCONNECT;

FOR i = 0 to NoOfRows('tables')-1
LET sheetName = purgeChar(purgeChar(peek('TABLE_NAME', i, 'tables'), chr(39)), chr(36));
Table:
Load * ,
FileBaseName()as FIle,
FileDir() as Dir,
FileName() as File_Name,
'$(sheetName)' as Sheet_name
From $(file)(ooxml, embedded labels, table is [$(sheetName)]);

NEXT i

Next

 

I am getting connection not found error at ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];

 

Can you please help me to understand what does "ODBC CONNECT32 TO [Excel Files;DBQ=$(file)];" do and how to create one in my Qlik sense app.

 

Thanks in advance

Labels (3)
1 Reply
Vegar
MVP
MVP

The command ODBC CONNECT32 TO [Excel Files;DBQ=$(file)]; tried to connect to your excel using an ODBC connection on the machine that is running the script.

I guess you will need to have an Excel odbc driver installed fot that command to work.