我创建了一个表格报告,其中包含几个明细,通过以下表达式在每个表组的顶部小计
代码:
=Sum(Fields!StandardTime.Value)
数据:
+-------+---+------------+----+----------+
|Company|Job|StandardTime|User|ActualTime|
+-------+---+------------+----+----------+
|Wirebox|tx | 5 |Joe | 1 |
|Wirebox|tx | 5 |Theo| 3 |
|Wirebox|ty | 10 |Joe | 4 |
|Wirebox|ty | 10 |Theo| 7 |
+-------+---+------------+----+----------+
报告:
+-------+---+------------+----+----------+
|Company|Job|StandardTime|User|ActualTime|
+-------+---+------------+----+----------+
|Wirebox| | 15 | | 15 |<---Company Total
| |tx | 5 | | 4 |<---Job Total
| | | |Joe | 1 |
| | | |Theo| 3 |
| |ty | 10 | | 11 |<---Job Total
| | | |Joe | 4 |
| | | |Theo| 7 |
+-------+---+------------+----+----------+
我遇到的问题是,当我将 StandardTime 加在一起以获得 =Sum(Fields!StandardTime.Value) 的公司总数时,结果是 30,而不是根据我的示例所需的 15。我猜该报告正在为 SQL 查询添加所有 StandardTime。但是该数据在查询中重复。有没有办法只汇总我在报告中输出的数字?