Reputation: 103
I am trying to do calculation by using expression.
In fact I have the formula to validate whether the report items that used to calculate is 0, this is because if both report items is 0, they not allowed to divided. So if both of the report items is 0, then 0.00 will be assigned to the column instead of process the calculation.
This is my expression which still show #Error in the report column even I have do IIf:
=IIf((ReportItems!TotalQty.Value = "0.000" And ReportItems!Textbox40.Value = "0.000"), ReportItems!Textbox6.Value="0.00", FormatNumber((ReportItems!TotalQty.Value / ReportItems!Textbox40.Value * 100), 2))
*ReportItems!Textbox40.value is Grandtotal for TotalQty
Do anyone know any way to correct this error.
Please help and guide. Thanks in advance.
Upvotes: 0
Views: 2298
Reputation: 11
The expression should be (imho)
=If(Val(ReportItems!Textbox40.Value) = 0,
0.00,
Val(ReportItems!TotalQty.Value) / Val(ReportItems!Textbox40.Value) * 100
)
Upvotes: 1