Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
is it possible to load a table according to a database filed value. ie, if the value of that field is zero then it should throw error,else it should run the script.
Raise Error based on DB value
Load
Value
From Xtable;
if value=0,then fail script
You can do that. Logic here you will check a condition before running script.
To control this you need to put actual code in the form of sub routines. You can have as many sub routines you want.
Just see attached QVW.
LOAD * INLINE [
CheckValue
1
];
Let VEXITCOUNT=Peek('CheckValue',0,'Exit_loop_table');
exit script when VEXITCOUNT = 0;
IF VEXITCOUNT > 0 then
Call CodeScript;
END IF;
Hi,
Thank you for your reply, it was very much helpful , will it be possible to throw an error message when that condition not satisfied or else the script execution should be cancelled.
Thanks in advance.
You can try using Exit Script command conditionally, something like:
If( <condition>) Then
Exit Script;
End If
ok.
I guess you will be running this task from QEMC once the development is completed.
Then where do you want to see the message while QEMC running the QVW?
replace 1=1 with your condition for error check
set ErrorMode=2;
IF (1=1) THEN
load * Resident TableNotExists;
ENDIF;
you'll get a in qlik desktop
on a server you can config to send an alert mail
hi,
kindly post me a sample application.
Thanks..
hi,
in my application after successful reload it will generate a PDF and send mail using publisher .so my concern is like if the condition doesn't satisfies it wont run the script, it would show error message otherwise it will generate a PDF.
Thankss...
Its easy, write an if else statement. If value is 0, ask it to look for file which will never exist. Then the job obviously fails. Use QMEC to send an email if it fails.
Suraj