This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion board where members can learn more about Qlik Sense App Development and Usage.
Hi. How can I raise an exception if I have a "0 lines fetched" during any point in the reload task?
2016-11-30 08:00:06 0104 FROM [myDatabase].[dbo].[myTransactionsTable]
2016-11-30 08:00:06 0105 WHERE TranType IN (
2016-11-30 08:00:06 0106 'buy'
2016-11-30 08:00:06 0107 ,'sell'
2016-11-30 08:00:06 0108 )
2016-11-30 08:00:06 0109 AND InvCode NOT LIKE '%collateral%'
2016-11-30 08:00:06 0110
2016-11-30 08:00:06 0111 ORDER BY TDate DESC
2016-11-30 08:00:07 30 fields found: *** OMITTED FOR BREVITY ***
2016-11-30 08:00:07 0 lines fetched
The only way to raise an exception is to introduce an intentional syntax error like this:
IF NoOfRows('TableName')=0 THEN
Failing due to no rows;
The "Failing due to no rows" is an invalid statement, but it will nicely show as the error cause as well.
View solution in original post
Hi Khoa, the function NoOfRows('TableName') returns the number of rows, you can check if it's equal to zero.
How do I then raise an exception? Thus marking reload task as failure?
Hi Khoa, you can finish the reload with "Exit Script;" Is this what you want?
You can use it like:
Exit script when NoOfRows('TableName')=0
Would Exit Script; cause the task to end in failure in QMC? Because this is what I want. I need an easy way to, at a glance, tell fail from success of my tasks.