【问题标题】:SSRS expression evaluation not workingSSRS 表达式评估不起作用
【发布时间】:2013-08-09 15:46:24
【问题描述】:

共享数据集返回两列: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

【问题讨论】:

    标签: ssrs-2008 ssrs-expression


    【解决方案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))
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多