Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlik Master,
I have a req to store load error into a table (can be txt / qvd).
I've tried solution from : ErrorHandling in Qlikview
But it won't work.
My script is like below :
Capture and Store Load Error |
---|
LOAD * INLINE [
LEGAL,ErrorScript
'$(vFlag)','$(ScriptError)'
];
And it doesn't work.
I've tried to create variable :
Let vScriptError= ScriptError;
And change mw script to below :
New Capture and Store Load Error |
---|
LOAD * INLINE [ LEGAL,ErrorScript '$(vFlag)','$(vScriptError)' ]; |
But still no error captured.
Is there any solution for this?
Many thank you,
Best Regards,
>>where to put purgechar() script?
You may not need this:
LOAD '$(vFlag)' as LEGAL,
PurgeChar('$(vScriptError)', chr(39)&';') as ErrorScript
AutoGenerate 1;
The second parameter should contain all the characters to strip. If you TRACE vScriptError, you will be able to see if there is anything to strip.
Try without quotes, like:
LOAD * INLINE [
LEGAL,ErrorScript
'$(vFlag),$(ScriptError)
];
ScriptError must be in the line immediately after the error causing line, and it may contain punctuation, so you may need a PurgeChar() to allow for saving in a load. Also use Autogenerate rather than inline
LOAD '$(vFlag)' as LEGAL,
'$(vScriptError)' as ErrorScript
AutoGenerate 1;
i've tries that and doesn't work.
thank you anyway
where to put purgechar() script?
thank you
See a working script
set ErrorMode=0;
Load * from abc.csv; // this file doesn't exists
load * Inline [
Error
$(ScriptError)
]
You would get 'File Not Found' as field value.
>>where to put purgechar() script?
You may not need this:
LOAD '$(vFlag)' as LEGAL,
PurgeChar('$(vScriptError)', chr(39)&';') as ErrorScript
AutoGenerate 1;
The second parameter should contain all the characters to strip. If you TRACE vScriptError, you will be able to see if there is anything to strip.
your solution does worked, but it has no complete error detail.
i've combined with jonathan solution and it works.
THank you a lot
thank you for your solution, it gave me clue to create the script.
and it worked.
my current script is :
LOAD '$(vFlag)' as Legal,
'$(ScriptError)' as Error,
'$(ScriptErrorDetails)' as ErrorDetail,
today() as ErrorDate
AutoGenerate 1;
thank you a lot