0

I'm working on a SSRS report and I keep getting a NaN value when I'm doing a divide here. How can I replace the NaN with 0 in my statement?

=Fields!Whse_QTY.Value/Fields!Total_QTY_Sales.Value
Ian Preston
  • 38,816
  • 8
  • 95
  • 92
GabrielVa
  • 2,353
  • 9
  • 37
  • 59

1 Answers1

1

You need to be careful due to the lack of short circuiting in the IIf statement.

Something like:

=IIf(Fields!Total_QTY_Sales.Value = 0, 0, Fields!Whse_QTY.Value)
  / IIf(Fields!Total_QTY_Sales.Value = 0, 1, Fields!Total_QTY_Sales.Value)

should do the job.

Ian Preston
  • 38,816
  • 8
  • 95
  • 92