Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

"ScriptErrorDetails" not fetching multiple error details

Hi,

I need help in using ScriptErrorDetails.

I am using below code to fetch data from multiple excel files:

  ---------------------------------
Read_Files:

LOAD
*

FROM
Z:\files\*my_file*.xlsx
(
ooxml, embedded labels, table is Open);

ErrorDetails:
Load
'$(ScriptErrorDetails)'
as vScriptErrorDetail
AutoGenerate(1);

------------------------------------

After running this, i get following value in vScriptErrorDetail :

Field not found - <Emp-Id>

However there were 2 fields that were missing in different files:

Emp-Name column was missing in one and Emp-Id column in another.

But vScriptErrorDetail is storing only error in file read last.

I want vScriptErrorDetail  to give following result:

Field not found - <Emp-Name>

Field not found - <Emp-Id>

If we have 2 or more field error during the reload, my purpose is to show my users that these are the fields causing the error. Hope I am making it clear for you to help.

5 Replies
Gysbert_Wassenaar

Qlikview will stop executing the script on the first error unless you set the ErrorMode variable to 0 first.

SET ErrorMode = 0;


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Amir,

isn't it possible to store error in the main table ?

Read_Files:

LOAD
*,

'$(ScriptErrorDetails)' as vScriptErrorDetail

FROM
Z:\files\*my_file*.xlsx
(
ooxml, embedded labels, table is Open);

Chris

Not applicable
Author

Hi christianj ,


This won't fetch the required info as vScriptErrorDetail will get null values.

This is because there aren't any rows being fetched from the file where columns are missing.

Sanjeet

Not applicable
Author

Hi

sure i read too fast

but you can add

ScriptErrorList  which will give a detailled list of the errors and

ScriptErrorCount will gives the number of errors


it can help


Chris

Not applicable
Author

Hi ,

ScriptErrorList gives the error 2 times for fields missing in 2 excel files:

Field Not Found

Field Not Found

But it doesn't give complete info regarding error, like:

Field Not Found - <Emp-Name>

Field Not Found - <Emp-Id>

ScriptErrorDetail gives o/p as:

Field Not Found - <Emp-Id>

and not for both files.

Still not getting the required o/p