Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto Row Number in SSRS Table with Grouped Rows

I am working with SSRS 2008. In one of my report I have a table with 3 columns. Sr. No, Column 1, Column2. Sr. No is -RowNumber("DataSet") and other are two are data set columns. I have grouped (Row Group) my table on Column 1 and Column 2. This is ok but the Sr.No column doesn't show right count it shows row number of grouped row e.g 2,4,9,10 so on. I want to keep the Sr.No or row number after grouping and on top of my table I want to show the count of rows in my table after grouping.

please suggest

like image 764
V.B Avatar asked Apr 05 '13 09:04

V.B


1 Answers

For distinct numbering of rows you can try this:

=RunningValue(CountDistinct("YourTableName"),Count,"YourTableName")

If you have only one grouping level in your report, you could group your values in the SQL query and then add new column ROW_NUMBER() OVER(...) numbering your rows in SQL query already.

like image 189
Konrad Z. Avatar answered Oct 06 '22 00:10

Konrad Z.