How to fix Infinity and Nan

  • I am getting "Infinity" or a "NaN" value on my expression below. Suggestions on my expression to improve it?

    =Sum(CDbl(IIF(Fields!Type.Value = "Charges", Fields!PatientAmount.Value + Fields!InsuranceAmount.Value, 0))) /(CountDistinct(iif(Fields!IsEncounter.Value = 1, Fields!PatientVisitId2.Value,Nothing)) - COUNTDISTINCT (IIF(Fields!IsEncounter.Value = -1, Fields!PatientVisitId2.Value,Nothing)))

  • It sounds like a possible divide by zero error.  Try wrapping the whole thing in an IIF to replace the result with Nothing if the denominator is zero.  So if the expression was =(A/B), something like =IIF(Fields.B.Value = 0, Nothing, (A/B)).

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply