SSRS 2005 - 运行组计数

发布于 2024-09-01 06:37:32 字数 277 浏览 7 评论 0原文

如何通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

最冷一天 2024-09-08 06:37:32

=RunningValue(Fields!Employee.Value, CountDistinct, Nothing)

瞧!

=RunningValue(Fields!Employee.Value, CountDistinct, Nothing)

Voila!

薄凉少年不暖心 2024-09-08 06:37:32

使用

RowNumber("table1_Group1")

Use

RowNumber("table1_Group1")
清泪尽 2024-09-08 06:37:32

我知道这已经很旧了,但我将其分享给有同样问题的人。

这取决于您的表格和分组级别。例如,假设我有一个详细信息组和两个名为“Parent”和“Child”的父组。

Parent{
    Child{
        Details group{

仅使用“RowNumber”函数将仅返回详细信息组中的记录,而不是行组中的记录。然而,Riegardt 非常接近,即使这也不能解释分组或空(“无”)的级别。
如果这要应用于我上面提到的结构中名为“Child”的组,则这是行不通的。
此外,如果列中存在具有空(“无”)值的记录,计数可能会不一致。
“Count”和“CountDistinct”对于空值从零开始计数,对于非空值从一开始计数(这也适用于“RunningValue”函数的参数)。
解决方案是包含当前正在计数的组之上的所有父组,甚至不允许列中的值首先返回 null。这是我的解决方案:

Row Groups within a parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString & IIf(IsNothing(Fields!ChildFieldValue.Value), "", Fields!ChildFieldValue.Value).ToString, CountDistinct, Nothing)

Row Groups with no parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString, CountDistinct, Nothing)

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".

Parent{
    Child{
        Details group{

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:

Row Groups within a parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString & IIf(IsNothing(Fields!ChildFieldValue.Value), "", Fields!ChildFieldValue.Value).ToString, CountDistinct, Nothing)

Row Groups with no parent Group:
=RunningValue(IIf(IsNothing(Fields!ParentFieldValue.Value), "", Fields!ParentFieldValue.Value).ToString, CountDistinct, Nothing)
晨曦÷微暖 2024-09-08 06:37:32

好的,我有一个解决方法,仅有效,因为每个组的行数是恒定的。

=(RowNumber("table2"))/(RowNumber("table2_Group1"))

这将适用于本报告的范围,但似乎仍然应该有一种更简单的方法...

OK, I have a workaround that only is valid because the number of rows is constant for each group.

=(RowNumber("table2"))/(RowNumber("table2_Group1"))

This will work for the scope of this report, but it still seems like there should be an easier way...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文