0

I have the following issue in SSRS when I'm doing the following calculations.

For the columns under Total Number - I'm doing the following -

=SUM(IIF(Fields!CallbackStatus.Value="Completed",1,0))

and

=SUM(IIF(Fields!CallbackStatus.Value="Outstanding",1,0))

In this particular example - the Total number of Callbacks is 0. Why by using the above expression would the below not pull back a 0 and instead a blank field.

Also in the % of Total I'm getting NaN. I'm also wanting that to be 0 if it's NaN. The functions for this is below -

=ReportItems!Textbox57.Value / ReportItems!Textbox54.Value

and

=ReportItems!Textbox61.Value / ReportItems!Textbox54.Value

any help would be great. Thanks

report

Pedram
  • 6,256
  • 10
  • 65
  • 87
ikilledbill
  • 211
  • 1
  • 3
  • 17

2 Answers2

0

For your first issue, I'd change the expression from a Sum to a Count (since it sounds like you're truly counting the matching records):

=COUNT(IIF(Fields!CallbackStatus.Value="Completed",1,Nothing))

Regarding the NaN problem, it's returning NaN ("Not a Number"), because the expression is trying to divide by 0. I'd use an IIf expression such as:

=IIf(ReportItems!Textbox54.Value=0, Nothing, ReportItems!Textbox61.Value / ReportItems!Textbox54.Value)
Jeffrey Van Laethem
  • 2,601
  • 1
  • 20
  • 30
0

Regarding the Nan divide by zero error, you can add some report code to handle this issue, see my answer here:

SSRS Expression Divide by Zero Error

Community
  • 1
  • 1
Nathan Griffiths
  • 12,277
  • 2
  • 34
  • 51