My table contains 2 columns with numbers:
ORIGINAL_QTY FINAL_QTY
120 115
1 0
1 1
0 0
3 1
4 5
And I need to extract the diference between both numbers as a percentage, so I created the following expresion, taking into account increase o decrease in final quantity (swaping numerator and denominator) or 0 in denominator (changing 0 with 0.00001 will do the job because I round to 2 decimals):
=IIf(Fields!ORIGINAL_QTY.Value=0, (Fields!FINAL_QTY.Value/0.00001)*100, IIf(Fields!ORIGINAL_QTY.Value>=Fields!FINAL_QTY.Value, (Fields!FINAL_QTY.Value/Fields!ORIGINAL_QTY.Value)*100, (Fields!ORIGINAL_QTY.Value/Fields!FINAL_QTY.Value)*100))
But still throws me "error: divided by zero" on rows 2 and 4:
Row 2: Its just 0/1=0, nothing special, shouldn't throw error. Row 4: ORIGINAL_QTY = 0, but I took care of it in the expresion so...
What am I missing? Checked everything and it should work...