divide by zero error
Posted 02 February 2012 - 01:46 PM
I have a simple calculated field, which is one column divided by another. If the denominator is 0, I get the error 'Divide By Zero Error'. I would like to handle that case within the calculated field if possible ( instead of the SQL or the Data Range), but I am not sure how to write the expression, so that the code will compile and return just 0.
I tried using the ISERROR function, but that doesn't seem to work.
Any suggestions how I should do this?
here's my calculated field:
GROSS_SALES_CNT / TOTAL_CONTACT_CNT
Posted 02 February 2012 - 11:06 PM
BirtMath.safeDivide(GROSS_SALES_CNT, TOTAL_CONTACT_CNT,0.0) in the exrepssion field of calculated value.