0
votes

This is the expression used for calculating the value:

=iif((Sum(CDbl(Fields!RxCount.Value))=0),"0.00",(Sum(Fields!Margin.Value)/Sum(CDec(Fields!RxCount.Value))))

ie:

if Sum(CDbl(Fields!RxCount.Value = 0, result shoul be 0.00 otherwise it should be the divide of two values.

but it display #error when Sum(CDbl(Fields!RxCount.Value = 0 not 0.00

Any help.

1
There are a number of duplicates of this question. Search on SSRS iif #error to find many answers pointing at a couple of different workarounds. - Jamie F
Maybe field Fields!RxCount.Value doesn't return integer/decimal value or value that can be converted to integer. - Konrad Z.

1 Answers

1
votes

You need to test for null values as well, the #Error is likely occurring because

Sum(CDbl(Fields!RxCount.Value)) 

is returning a null value, not a 0.