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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
EvanBarrick
Creator
Creator

Unknown LOAD statement error

I am attempting to run the following script:

 

thsSALESDATA:
BUFFER (incremental) LOAD * FROM [lib://THS Aggregate (brand_mike.smith)/*.xlsx](ooxml, embedded labels, table is THS);

STORE thsSALESDATA INTO [lib://QVD (brand_mike.smith)/THSaggregate.qvd(qvd)];

There are three files in the directory from which I am loading; they all have the same number of columns and exactly the same headers. 

What could be causing this error?

 

1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

Sorry i missed next file line at the end and forgot it was qlik sense.

see below change lib://TestLoop to your connection string

set vRoot = 'lib://TestLoop';
FOR Each File in filelist ('$(vRoot)'&'\*.xlsx')
Temp:
LOAD *
FROM
[$(File)]
(ooxml, no labels, table is data);
let qvdname= replace(File,'xlsx','qvd');

next File

View solution in original post

13 Replies
dplr-rn
Partner - Master III
Partner - Master III

can you share the error log/output
EvanBarrick
Creator
Creator
Author

The following error occurred:
Unknown LOAD statement error
 
The error occurred here:
TMsalesData: BUFFER (incremental) LOAD * FROM [lib://TMaggregate (brand_mike.smith)/*.xlsx](ooxml, embedded labels, table is TM)
 
The following error occurred:
Unknown LOAD statement error
 
The error occurred here:
?
dplr-rn
Partner - Master III
Partner - Master III

Hard to help my friend.
but buffer incremental afik only works on text files (csvs) not xlsx
not sure if this is the cause but worth a try
EvanBarrick
Creator
Creator
Author

I have used this script for similar directories with .xlsx files several times, which is why this is puzzling

dplr-rn
Partner - Master III
Partner - Master III

to identify the error i recommend Trying to load the files without the *.xlsx
if you have a lot of files there try a loop like below you can eliminate issues with the files

set vRoot = '.';
FOR Each File in filelist ('$(vRoot)'&'\*.xlsx')
Temp:
LOAD *
FROM
[$(File)]
(ooxml, no labels, table is data);
let qvdname= replace(File,'xlsx','qvd');


next File
EvanBarrick
Creator
Creator
Author

Thanks for this, where do I designate where my directory in your example?

dplr-rn
Partner - Master III
Partner - Master III

vRoot 

dplr-rn
Partner - Master III
Partner - Master III

personally i dislike load with *.xlsx hard to pin down errors. e.g. someone put a extra space in tab name etc.
i tend to use a loop like this which will error out at the exact file which causes problem
EvanBarrick
Creator
Creator
Author

set vRoot = '.';

FOR Each File in filelist ('$(The Store Name Agg (brand_mike.smith)\*.xlsx')
Temp:
LOAD *
FROM
[$(File)]
(ooxml, no labels, table is THS);
let qvdname= replace(File,'xlsx','qvd');


next File