SQL Server报表生成器:如何获取每组的SUM(值)
我有一个按 Field1 分组的报告,按页面分隔,在每个页面中我按 Field2 分组。
所以,我的页面是:
Field1 Field2 SUM(Volume)
...
Total SUM(Volume) --This is the value that I want to use!!
我有一个 Volume 字段,我想要计算百分比:
Sum(Fields!Volume.Value)
是值的聚合,这是正确的sum(Fields!Volume.Value, "DataSet2")
是所有内容的总计,这是不正确的,因为我想要每页的总计。
我正在做:
=(Sum(Fields!Volume.Value) * 100) / sum(Fields!Volume.Value, "DataSet1")
我正在使用Report Builder 2.0,我无法更改。
我希望我能解释清楚,
谢谢!
I have a report group by Field1 separated by pages, in each page I group by Field2.
So, my page is:
Field1 Field2 SUM(Volume)
...
Total SUM(Volume) --This is the value that I want to use!!
I have a Volume field that I want to do a percentage:
Sum(Fields!Volume.Value)
is the aggregation of the value, that is correctsum(Fields!Volume.Value, "DataSet2")
is total of everything, that is incorrect because I want total of each page.
I am doing:
=(Sum(Fields!Volume.Value) * 100) / sum(Fields!Volume.Value, "DataSet1")
I am using, Report Builder 2.0 and I am not able to change.
I hope I explained myself ok,
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以对组(在本例中为 Field2 组)的总计进行聚合,将其用作数据集。因此,尝试以下操作:
(Sum(Fields!Volume.Value) * 100) / sum(Fields!Volume.Value, "Field2")
但将
Field2
替换为实际值该组的名称。You can do aggregations with the total of a group (in this case, the Field2 group), using it as if it were a dataset. So, try this:
(Sum(Fields!Volume.Value) * 100) / sum(Fields!Volume.Value, "Field2")
But replace
Field2
with the actual name of that group.