Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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