Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 Adding row count to grouped details

Author  Topic 

blund
Starting Member

23 Posts

Posted - 2012-02-09 : 18:20:08
In SSRS, is there a way to add a row count within a group of data that resets for each group?

For example:

CategoryA
. Detail 1a. 1
. Detail 1b. 2
CategoryB
. Detail 2a. 1
. Detail 2b. 2
. Detail 2c. 3
CategoryC
. Detail 1a. 1

etc...

Simply using rowcount("table1") does not reset the count for each group, and I get the running total, up to 6, in the example above.

Also, probably a dumb question, I have the "." in the data to shift the columns, because my "spaces" get dropped during the preview. Is there a character needed to properly align columns in the post. Tab key just acts like a windows command and moves the selection to the next section or button.

Thank you

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-09 : 18:29:24
you should be using
=rownumber("secondlevelgroupname")

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

blund
Starting Member

23 Posts

Posted - 2012-02-10 : 09:46:13
Works wonderfully!

Is there a proper way to format my posts, so that I can better show the column alignments? So that all my spaces are not truncated when submitting the post?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-10 : 10:32:24
you can enclose then within <square bracket here>code<square bracket here> and <square bracket here>/code<square bracket here>
tags

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

blund
Starting Member

23 Posts

Posted - 2012-02-10 : 12:24:32
Got it... Thanks again.


CATEGORY DETAIL COUNT
CategoryA
Detail1a 1
Detail1b 2

CategoryB
Detail2a 1
Detail2b 2
Detail2c 3
CategoryC
Detail3a 1


Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-10 : 12:33:59
cool

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -