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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
alvinford
Contributor III
Contributor III

Whats Wrong with this Code

Hi All,

I am trying to Load maultiple sheets from Excel. (Dont want to load first 20 Lines of each Excel). Using the below code but its shooting error. Can I know whats wrong with this code.

LET SourcePath='C:\Qlikview\Check\Test\*.xlsx';

For each File in Filelist ('$(SourcePath)')          ;

 

ODBC CONNECT TO [Excel Files;DBQ=$(File)];

 

tables:

SQLtables;

FOR i = 0 to NoOfRows('tables')-1

          LET SheetName = peek('TABLE_NAME', i, 'tables');

Test:

          LOAD *

          From [$(File)]

         (ooxml, embedded labels, header is 20 lines, table is ['$(SheetName)']);

Next

Next File

Drop table tables;

Need you help to know whats wrong with above code.

Regards,

Alvin.

Labels (1)
11 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Should not use Purge chart here.

It removes all the $ symbols in that name.

You should use

LET SheetName = left(peek('TABLE_NAME', i, 'tables'), len(peek('TABLE_NAME', i, 'tables')) - 1);

CELAMBARASAN
Partner - Champion
Partner - Champion

Opened status in the sense "Opened by OLE DB Provider for data access".

And you are trying to access by normal file read.