Discussion Board for collaboration on QlikView Scripting.
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)
Go to Solution.
(Not sure if you need that.)
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.
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?
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 -
please see the attached thread - it may be of some help
How can I intentionally create a script error?
You can use the
SET ErrorMode= 0;
ErrorMode takes 0,1,2 and other values depending on your requirement.
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.