私は次のようなssrsにマトリックスを持っています:
+--------------------+-------------------------+
| | Date |
+ +----------+--------------+
| | Quantity | All Quantity |
+----------+---------+----------+--------------+
| Employee | Total | | |
+ +---------+----------+--------------+
| | Product | | |
+----------+---------+----------+--------------+
この表Employee
では、Row group
とProduct
は子row group
です。Date
ですcolumn group
。フィールドにはQuantity
、データベースからの数字があります。列には、このAll Quantity
の合計金額が必要です。しかし、私の式を使用すると、すべてのデータを使用して計算されます。 Quantity
Date group
All Quantity
Date groups
つまり、日付「2012-07-13」の場合、すべての数量は 1000 であり、日付「2012-06-12」の場合は 500 である必要があります。しかし、その代わりに、両方の日付で 1500 と表示されます。これをどのように解決すればよいですか?
私の表現はここにあります:
Sum(Fields!Quantity.Value, "Employee")
データセットは次のようになります。
Employee1 Product1 200 2012-01
Employee1 Product1 500 2012-02
Employee1 Product1 900 2012-03
Employee1 Product2 300 2012-01
Employee1 Product2 500 2012-02
Employee1 Product2 40 2012-03
Employee2 Product1 450 2012-01
Employee2 Product1 50 2012-02
Employee2 Product1 30 2012-03
Employee2 Product2 0 2012-01
Employee2 Product2 50 2012-02
Employee2 Product2 120 2012-03
これは、私が持っているもの、得たもの、必要なものの例です。
//IF I USE Sum(Fields!Quantity.Value)
Date1 Date2
Quantity All Quantity Quantity All Quantity
Employee1 Total 590 - 190 -
100 100 50 50
200 100 50 50
150 150 40 40
50 50 30 30
90 50 20 20
//IF I USE Sum(Fields!Quantity.Value, "Employee")
Date1 Date2
Quantity All Quantity Quantity All Quantity
Employee1 Total 590 - 190 -
100 780 50 780
200 780 50 780
150 780 40 780
50 780 30 780
90 780 20 780
//I NEED TO GET
Date1 Date2
Quantity All Quantity Quantity All Quantity
Employee1 Total 590 - 190 -
100 590 50 190
200 590 50 190
150 590 40 190
50 590 30 190
90 590 20 190