Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to fail?

Hello,

Is there a good way (apart from deliberate faulty code) to make a script execution fail?

E. g., when some checking condtion is not met.

("exit script" is not what I want, since it merely exits without failing)

1 Solution

Accepted Solutions
Qrishna
Master
Master

See attached.

(Not sure if you need that.)

View solution in original post

7 Replies
crystles
Partner - Creator III
Partner - Creator III

If you just want the script to fail, leave off the end of load statement symbol = ;

I know I've done it before... on accident usually though.

maxgro
MVP
MVP

No AFAIK.

There isn't a raise, exception or similar thing in Qlik to jump to an outer script section.

Actually, I don't see a reason you can't use a "deliberate faulty code" (example load from notexists.qvd) to make a script execution fail. Can you explain a little more in detail?

Not applicable
Author

can you please explain what you are trying to do?

If you set a condition tht will nexver be met, such as your example, that does not make the script fail since it is chedking a condition that is not met -

Not applicable
Author

please see the attached thread - it may be of some help

How can I intentionally create a script error?

Qrishna
Master
Master

See attached.

(Not sure if you need that.)

chaudhariv
Partner - Contributor III
Partner - Contributor III

You can use the

SET ErrorMode= 0;

ErrorMode takes 0,1,2 and other values depending on your requirement.

Not applicable
Author

Thanks all for useful answers! The conjuntion of the answers this far answers my question - I can use ErrorMode=2, and then intentionally write faulty code such as load * from bozofilename.qvd.

One of use of this is that in QMC i can have other tasks have different triggers depending so that some are triggered on the first ones success and others on failure in a more controlled manner.