Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Not applicable

How to interrupt reload and throw error if field is empty?

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?

Tags (1)
4 Replies
Not applicable

How to interrupt reload and throw error if field is empty?

this dont throw error:

load
if(len(column1)=0, 1/0, column1) as Column1
from ......


Not applicable

How to interrupt reload and throw error if field is empty?

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

Not applicable

Re: How to interrupt reload and throw error if field is empty?

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.

pieter1976
New Contributor III

Re: How to interrupt reload and throw error if field is empty?

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

Community Browser