我有这样的SSRS矩阵:SSRS列组
+--------------------+-------------------------+
| | Date |
+ +----------+--------------+
| | Quantity | All Quantity |
+----------+---------+----------+--------------+
| Employee | Total | | |
+ +---------+----------+--------------+
| | Product | | |
+----------+---------+----------+--------------+
在此表中Employee
是Row group
和Product
是一个孩子row group
。 Date
是column group
。在Quantity
字段中,我有来自我的数据库的数字。在All Quantity
列中,我需要在此Date group
中的总金额为Quantity
。但使用我的表达式,它使用来自所有Date groups
的数据计算All Quantity
。
我的意思是,对于日期“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
你可以添加一个样本数据集的问题的最后机会吗? – Jeroen 2012-07-13 13:58:07
我刚添加它。这是非常简单的数据集。 – JNM 2012-07-16 04:30:28
目前还不清楚“数量”和“所有数量”之间的区别是什么。尽管如此,我认为如果你的分组是正确的,那么简单的'Sum(Fields!Quantity.Value)'(不要指定任何分组)就应该做到这一点。 – Jeroen 2012-07-16 20:40:09