Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello.
I load data from excel files and I want to interrupt reload and throw error if some of column cell is empty.
Some ideas?
this dont throw error:
load
if(len(column1)=0, 1/0, column1) as Column1
from ......
Hi,
In order to interrupt script execution you can use "exit script".
With the trace statement you can write error messages into log file and script execution progress window.
Alex
I haven't found a command to throw exceptions but instead i use a dummy call to a sub that does not exist:
if someError then
call ThrowException('Error: some kind of error'); // the sub doesn't exist ==> qv error
end if
This will propagate an error back to the publisher and report the task as failed. If sometime in the future qliktech will implement a (or I learn how of) way to throw exceptions, for instance by letting us set "ScriptError", then it is easy to create the sub ThrowException to use that feature.
load
if(len(column1)=0, 'error', '') as event // this won't pickup null values.
..
..
let idxevent=FieldIndex('event','error');
if idxevent>0 then
error:
load
a
from 'field is zero'(qvd); // should be a non existing file.
endif