共享数据集返回两列:DaysEarly和NumberShipped。我想在表格中使用它来显示早期,按时和晚期的货运数量。数据如下所示:
DaysEarly NumberShipped
3 123
2 234
1 254
0 542 -- On time shipments
-1 43
-2 13
该表使用此数据集。我有以下表达式:
-- Early kits
=IIf(Fields!DaysEarly.Value > 0, Sum(Fields!NumberOfKits.Value),Nothing)
-- On Time Kits
=IIf(Fields!DaysEarly.Value = 0, Sum(Fields!NumberOfKits.Value), Nothing)
-- Late Kits
=IIf(Fields!DaysEarly.Value < 0, Sum(Fields!NumberOfKits.Value), Nothing)
最后一个表达式汇总所有货件。前两个返回以下消息:
The Value expression for the textrun...contains an error:
The query returned now rows for the dataset. The expression
therefore evaluates to null.
这样做的正确方法是什么?我正在根据以上数据寻找这样的结果:
Early shipments: 611
On time shipments: 542
Late shipments: 56
答案 0 :(得分:1)
您走在正确的轨道上,您需要在IIf
表达式中移动Sum
表达式:
早期:
=Sum(IIf(Fields!DaysEarly.Value > 0, Fields!NumberShipped.Value, Nothing))
准时:
=Sum(IIf(Fields!DaysEarly.Value = 0, Fields!NumberShipped.Value, Nothing))
后期:
=Sum(IIf(Fields!DaysEarly.Value < 0, Fields!NumberShipped.Value, Nothing))