我在ssrs
字段表达式中有这个表达式:
iif(Sum(Fields!ActualWeight.Value)<>0 ,
Sum(Fields!ActualWeight.Value *Fields!AchievedPCN.Value)/Sum(Fields!ActualWeight.Value)
,0)
当Sum(Fields!ActualWeight.Value) =0
和Sum(Fields!ActualWeight.Value *Fields!AchievedPCN.Value) =0
返回#Error
为什么会这样?我的ssrs
版本是2008年。
答案 0 :(得分:0)
=IIF((CInt(Sum(Fields!ActualWeight.Value))>0
and CInt(Sum(Fields!ActualWeight.Value *Fields!AchievedPCN.Value))>0),
(Sum(Fields!ActualWeight.Value *Fields!AchievedPCN.Value))/iif(Sum(Fields!ActualWeight.Value)=0,1,Sum(Fields!ActualWeight.Value)),0)
我必须将它添加到Denominator:
iif(Sum(Fields!ActualWeight.Value)=0,1,Sum(Fields!ActualWeight.Value)
而不是
Sum(Fields!ActualWeight.Value)