1

共有データ セットは、DaysEarly と NumberShipped の 2 つの列を返します。これをテーブルで使用して、早い、時間通り、遅れた出荷の数を表示したいと考えています。データは次のようになります。

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)

最後の式は、すべての出荷を合計します。最初の 2 つは、次のメッセージを返します。

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
4

1 に答える 1

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))
于 2013-08-09T16:01:47.337 に答える