How to show row count in SSRS per grouping on variable group-by value?
Asked Answered
G

2

14

Essentially, I'd like to have separate row counts per grouping. I believe I'm supposed to use RowNumber. This seems to have been discussed but I'm having difficulty due to the fact that my groupby is not a string constant.

My attempts have lead to something that is similar to :

=RowNumber(Parameters!GroupBy1.Value)

The SSRS report doesn't load if I have this set as it is.

Row counts per DS work. If instead I use:

=RowNumber("NameOfMyDataSet")

I'll have row counts successfully, but without resetting per group.

How can I reset the row-count per group if I'm using a variable group-by name?

Gorden answered 22/4, 2013 at 19:20 Comment(0)
P
30

You need to set the scope of the function as the name of the group, not the DataSet, something like:

=RowNumber("Group1")

Edit after comment:

As above this is the name of the group created in the report, not any of the values in the DataSet.

In Designer:

enter image description here

Group properties:

enter image description here

Puss answered 22/4, 2013 at 19:46 Comment(4)
This is not very helpful. As my question indicated I do not have the string constant name of the group-by. It is variable and set via parameters.Nonprofit
@Rail24, as above you need the name defined when you created the group. This is a report object and has a static name.Puss
Ah. I've been misunderstanding articles all day then. I apologize as this is very helpful. Thank you.Nonprofit
Thanks! Worked for me.Preamble
A
1

We can use the “RunningValue” function in SSRS. The format for the expression would be.

=RunningValue(Grouped field,CountDistinct,”DataSetName”)

Eg: =RunningValue(Fields!Name.Value,CountDistinct,”Accounts”)

Amphibolite answered 28/4 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.