Search code examples
doublessrs-2008infinity

How do I deterimine if a double is not infinity, -infinity or Nan in SSRS?


If got a dataset returned from SSAS where some records may be infinity or -infinity (calculated in SSAS not in the report).

I want to calculate the average of this column but ignore those records that are positive or negative infinity.

My thought is to create a calculated field that would logically do this:

= IIF(IsInfinity(Fields!ASP.Value) or IsNegativeInfinity(Fields!ASP.Value), 0 Fields!ASP.Value)

What I can't figure out is how to do the IsInfinity or IsNegativeInfinity.

Or conversely is there a way to calculate Average for a column ignoring those records?


Solution

  • Just stumbled across this problem and found a simple solution for determining whether a numeric field is infinity.

    =iif((Fields!Amount.Value+1).Equals(Fields!Amount.Value), false,true)