R – conditional sum not working on certain datatypes

reportingreporting-services

I have a conditional sum in my grouping

=sum(iif(Fields!Letter.Value="Service",0,Fields!Mailed.Value))

I keep getting the #error on half the fields. There all numbers. In my proc im calling the fields that are erroring outare doing a calculation. I tried putting those into a subquery and calling and it errored out. Im not sure where to go from here.

Any ideas on why this may be and how to fix it?

Best Answer

This snippet shows a solution:

=Sum(iif(Fields!Status.value = "Value a", Cdbl(Fields!Payment.Value), 0.0))

Worked for me. Apparently you have to set the same data type in both results either true or false.

Related Topic