简体   繁体   English

对SSRS中的分组数据求和

[英]Sum Grouped Data in SSRS

I want to SUM grouped data in a report but can't figure out a way to do it. 我想对报告中的分组数据求和,但找不到解决方法。

My data looks something like this: 我的数据如下所示: 在此处输入图片说明

I am trying to get value 4 in Grand Total which would show the number of orders on different schedules. 我试图在“总计”中获取值4,该值将显示不同时间表上的订单数。 Simple count would count all the detail lines giving me value 8, count distinct would give me value 3 as there are 3 unique orders. 简单计数将对所有明细行进行计数,使我获得价值8,而独特计数将对我进行计数,因为存在3个唯一订单。 Is there a way to sum subgroup totals (which are calculated as count distinct per schedule). 有没有一种方法可以汇总子组的总计(按每个计划计算为不同的计数)。 Thanks 谢谢

You could add a field to the dataset (either in the query, or as a calculated field in the dataset) called Schedule-Order, with values like "1234-1111", "1234-2222". 您可以将一个名为Schedule-Order的字段添加到数据集(在查询中或作为数据集中的计算字段),其值应为“ 1234-1111”,“ 1234-2222”。

Then you can do a count distinct on this field. 然后,您可以在此字段上进行计数。

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

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