Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulsud007
Creator
Creator

List of all error files

Dear all,

I want a list of all error files. Suppose in the script I have four load statement. In the First statement I have all the field name and the file. In the second load statement I have a field missing. In third and fourth load statement I have the file missing. I want to see all the errors.

I have used errormode=0; So that reload wont fail. But I want list of all errors. scripterrodetail shows only the last error in detail not the entire error.

Attaching my script and excel. Plz help

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

This is tested and works with your attachements:

set ErrorMode=0;

ABC:

LOAD ID,

     Name,

     Age

FROM

ABC.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  1 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

PQR.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  2 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

xyz.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  3 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

rsk.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  4 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

You will end up with a table named ERRORLIST that contains four rows and ScriptErrorDetails for each load statement...

View solution in original post

6 Replies
petter
Partner - Champion III
Partner - Champion III

You have the special variable ScriptErrorList which is actually a list of all errors... isn't that sufficient for you needs?

If not you can always use an:

ErrorList: LOAD $(ScriptErrorDetail) AUTOGENERATE 1;

After each load to get a single table containing all ScriptErrorDetails for the entire load script. Possibly storing the results at the end of the load script into a QVD for later reference...

rahulsud007
Creator
Creator
Author

Hi Peter,  Thanks for your reply. The Error detail will give u only the detail error of the last error not the entire list as I shown in my application above.

Can you please help with an demo application where I can see multiple errors with their filename?

petter
Partner - Champion III
Partner - Champion III

That is the purpose of using the LOAD .... AUTOGENERATE 1    after each load as it will by auto concatenation add multiple rows of ErrorDetails into this table called ErrorList. Give it a try...

petter
Partner - Champion III
Partner - Champion III

This is tested and works with your attachements:

set ErrorMode=0;

ABC:

LOAD ID,

     Name,

     Age

FROM

ABC.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  1 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

PQR.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  2 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

xyz.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  3 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

LOAD ID,

     Name,

     Age

FROM

rsk.xlsx

(ooxml, embedded labels, table is Sheet1);

ERRORLIST: LOAD  4 AS LoadNo, '$(ScriptErrorDetails)' AS ErrorDetail AUTOGENERATE 1;

You will end up with a table named ERRORLIST that contains four rows and ScriptErrorDetails for each load statement...

rahulsud007
Creator
Creator
Author

That was great Peter extremely thankful of you.

petter
Partner - Champion III
Partner - Champion III

My pleasure.