Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In Qlik Sense, in the load script. If a result of a variable is wrong, i'd like to interrupt the Script.
It's easy to interrupt the script : I use a if then else, and an EXIT SCRIPT; when I need to.
But is there a way to EXIT SCRIPT as an error ? I mean, when I do an EXIT SCRIPT, the reload stops, but in schedulers the reload appears as a successfull reload. Is there a way to exit script as a failed reload ?
(I'm looking equivalent to exit code = 1)
Thanks
Best Regards
@herard_bertrand Had a look at doing this in Cloud, this should work:
IF 1=1 then
Load * from NotReal.qvd;
End if
Alternatively if you dont like the alert just do something like this:
IF zVariable = 'Wrong value' then
Load * From [lib://ThisDoesntExist/FailHere.Qvd](qvd);
End if;
Regards Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
You can do it like this to avoid any syntax flags:
Set vFail=;
IF 1=1 then
Set vFail = 'Fail here!';
End If
$(vFail)
-Rob
I have had this as well - just do something like this.
IF zVariable = 'Wrong value' then
fail here;
End if;
"The word fail here is just in text so this will cause the application to fail" So in the script it looks like this
Regards Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
That's an interesting workaround.
I'm just not a fan of the constant alert of the syntax check, but it works 😉
thanks
*Presenter voice* Then you're just going to love our new... quotes!
IF 1=1 then
'fail here';
End if;
I also do not like the alert. 🙂
Heu... thanks but I still have the alert 😉 (I'm working on Qlik Cloud not On Premise maybe this is a difference)
@herard_bertrand Had a look at doing this in Cloud, this should work:
IF 1=1 then
Load * from NotReal.qvd;
End if
Alternatively if you dont like the alert just do something like this:
IF zVariable = 'Wrong value' then
Load * From [lib://ThisDoesntExist/FailHere.Qvd](qvd);
End if;
Regards Jandre
Mark the solution as accepted that solved your problem and if you found it useful, press the like button! Check out my YouTube Channel | Follow me on LinkedIn
OK, it will due,
Thanks
You can do it like this to avoid any syntax flags:
Set vFail=;
IF 1=1 then
Set vFail = 'Fail here!';
End If
$(vFail)
-Rob