简体   繁体   English

ssrs对特定组的总和总计,对特定组减去

[英]ssrs sum group totals for specific groups and subtract for specific groups

I have a report like this: 我有这样的报告:

费用SSRS报告

I have grouped on group name called expense type. 我对称为费用类型的组名称进行了分组。 Ideally expense type has three types, 1, 2 and 3. I have used them to sum up in TOTAL in blue line. 理想情况下,费用类型具有1、2和3这三种类型。我用它们将蓝色的TOTAL总计。

Now I want to add the total of totals to brown tan line, 现在,我想将总计添加到棕褐色行中,

I want ( (total of group 1 + total of group 3 ) - total of group 2 ) in the tan color total billing submitted. 我要在(棕褐色总帐单)中提交((第1组的总数+第3组的总数)-第2组的总数)。

Can anyone help me in writing this expression? 有人可以帮我写这个表情吗?

You can use report items to achieve what you want 您可以使用报告项目来实现所需的目标

for example.. 例如..

=(Reportitems!group1total.value +Reportitems!group3total.value )-Reportitems!group2total.value 

The above assumes that the property name for the group boxes are group1total, group2total and group3total 上面假设组框的属性名称为group1total,group2total和group3total

Use IIF() or SWITCH() to check the Category of each value before you calculate the totals. 在计算总计之前,请使用IIF()SWITCH()检查每个值的类别。

=(Sum(IIF(Fields!ExpenseCategory.Value = "Group 1", Fields!Amount.Value, nothing))
+ Sum(IIF(Fields!ExpenseCategory.Value = "Group 3", Fields!Amount.Value, nothing)) )
/ Sum(IIF(Fields!ExpenseCategory.Value = "Group 2", Fields!Amount.Value, nothing))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM