=(Sum(Fields!PRICE_EXT.Value, "OrderInfoConstruction") -
Sum(Fields!PRICE_EXT.Value, "OrderInfoClosedConstruction")) /
Sum(Fields!PRICE_EXT.Value, "OrderInfoClosedConstruction")
和“Sum(Fields!PRICE_EXT.Value,”OrderInfoClosedConstruction“)的值为0(前一个YTD值)。对于NaN值问题,它是相同的表达式,但在这种情况下,BOTH当前和之前的YTD是如果值为0以解除除以0的错误,什么是NaN,我怎么能只将它显示为“0”?我已经找到了一些帮助但是有不知道如何采用下面的IIF声明并根据我的陈述进行调整?
=IIf(Fields!SomeField.Value = 0, 0, Fields!SomeOtherField.Value / IIf(Fields!SomeField.Value = 0, 1, Fields!SomeField.Value))
提前感谢您的帮助!!!
答案 0 :(得分:0)
如果要为0/0
和#/0
显示0,则只需将分母值检查为零即可。基本上IIf(PrevYTD = 0, 0, (CurrYTD - PrevYTD) / PrevYTD)
或您的实际字段:
=IIf(Sum(Fields!PRICE_EXT.Value, "OrderInfoClosedConstruction") = 0, 0,
(Sum(Fields!PRICE_EXT.Value, "OrderInfoConstruction") -
Sum(Fields!PRICE_EXT.Value, "OrderInfoClosedConstruction")) /
Sum(Fields!PRICE_EXT.Value, "OrderInfoClosedConstruction"))
此外,NaN代表not a number,0/0
是产生它的一个操作。