SSRS 2005 - 运行组计数
如何通过 SSRS 2005 显示正在运行的 GROUP 计数?
我有一个包含 n 个组的报告,其中源数据必须保持匿名,并且我希望该数字出现在组的标题中...
因此,而不是像这样的组标题中的名称...
员工 - 约翰·史密斯
员工 - 玛丽·斯温
...
员工 - Ahmad Sal
我想要...
员工 #1
员工 #2
...
员工 #n
谢谢!!!
How do you you display the running GROUP count via SSRS 2005?
I have a report that has n groups where the source data must remain anonymous and I want that number in the header of the group...
So instead of the name in the group header like such...
Employee - John Smith
Employee - Mary Swain
...
Employee - Ahmad Sal
I want...
Employee #1
Employee #2
...
Employee #n
Thanks!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
=RunningValue(Fields!Employee.Value, CountDistinct, Nothing)
瞧!
=RunningValue(Fields!Employee.Value, CountDistinct, Nothing)
Voila!
使用
Use
我知道这已经很旧了,但我将其分享给有同样问题的人。
这取决于您的表格和分组级别。例如,假设我有一个详细信息组和两个名为“Parent”和“Child”的父组。
仅使用“RowNumber”函数将仅返回详细信息组中的记录,而不是行组中的记录。然而,Riegardt 非常接近,即使这也不能解释分组或空(“无”)的级别。
如果这要应用于我上面提到的结构中名为“Child”的组,则这是行不通的。
此外,如果列中存在具有空(“无”)值的记录,计数可能会不一致。
“Count”和“CountDistinct”对于空值从零开始计数,对于非空值从一开始计数(这也适用于“RunningValue”函数的参数)。
解决方案是包含当前正在计数的组之上的所有父组,甚至不允许列中的值首先返回 null。这是我的解决方案:
I know this is super old, but I'm sharing this for anyone having the same problem.
It depends on your table and the level of grouping. For example, let's say I have a Details group and two parent groups called "Parent" and "Child".
Using just the "RowNumber" function will only return records from a Details group, not from a Row Group. Riegardt was very close, however, even this doesn't account for the level of grouping or null ("Nothing").
If this was to be applied to the group called "Child" in the structure I mentioned above, this wouldn't work.
Also, The count would potentially be inconsistent if there were records in the column with a null ("Nothing") value.
"Count" and "CountDistinct" start their count at zero for null values and one for non-null values (this applies to the "RunningValue" function's parameter as well).
The solution is to include ALL parent groups above the current group you're counting and to not even allow the value from a column to return null in the first place. Here's my solution:
好的,我有一个解决方法,仅有效,因为每个组的行数是恒定的。
这将适用于本报告的范围,但似乎仍然应该有一种更简单的方法...
OK, I have a workaround that only is valid because the number of rows is constant for each group.
This will work for the scope of this report, but it still seems like there should be an easier way...