Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Storing Errors from script into table or qvd

Hi All,

I understand that QlikView can only catch one error at a time and and even store the number of times errors has occurred as a flag into a variable.

My new requirement needs me to store the type of errors that have occurred - file not found, field not found and wrong file format into a table or QVD so I can binary load it to the main app which contains the interface. I am implementing this in the QVD generation app. Any thoughts on how to accomplish this. Thank you

3 Replies
maxgro
MVP
MVP

You can set the ErrorMode variable to 0

check if there is an error

and trace the error in the log file or in a different log file

Error Handling in Qlikview

Re: Error handling in script

Anonymous
Not applicable
Author

Thanks for the info. I am working on resolving it. Will post the solution when I get it. It should be helpful to the community

wizardo
Creator III
Creator III

hi,

its imprtent to understand that qlik checks for errors for each "STATEMENT" it executes

when using a line like this:

     set vErrorVar = $(ScriptError);

to catch the error in the variable, this is also a "STATEMENT", so after its succesfull execution, the ScriptError variable

gets reseted to 0(zero), thats why you cannot keep it anymore.

what i do is use it inside a load......autogenerate statement like this:

set Errormode= 0; // to turn on error capture

//{put your statement/s you want to test if it had errors}

//notice that only an error in  last statement will be captured if you use more then one statement

MyScriptErros:

Load

'$(#ScriptError)' as [Error Number],

'$(ScriptErrorDetails)'  as [Error Details],

'Insert here Text about this specific load and any remarks you have' as [Desc]

AutoGenerate 1 where not '$(#ScriptError)'=0; //the where here prevents lines been added if no error

SET ErrorMode = 1;




now at the end of your script you can store/show the "MyScriptErros" table.

of course this is very simplistic and you can evolve it further:)


hope it helps

Wizardo