9

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

V.B
  • 1,191
  • 7
  • 29
  • 55
  • 1
    Would you be able to give an example table of your desired output based on some sample data? I found it a bit difficult to tell what is required here just from your description. – Ian Preston Apr 05 '13 at 13:14

1 Answers1

17

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.

Konrad Z.
  • 1,592
  • 4
  • 20
  • 34
  • How can i count grouped records in table? – V.B Apr 10 '13 at 11:14
  • If you group your values by only one column, you can add the expression (outside your group): =CountDistinct(). You can also add count of rows in page header, but then you have to display your whole table on one page. – Konrad Z. Apr 10 '13 at 11:32
  • I am grouping my table on 2 columns and I want to show the count of grouped rows (total rows after grouping) outside the table.Will it work? – V.B Apr 10 '13 at 11:34
  • What if you try this (in cell outside your group): =CountDistinct(Fields!yourGroupingColumnName1.Value + Fields!yourGroupingColumnName.Value2) – Konrad Z. Apr 10 '13 at 11:55
  • But I am looking for something outside the table. – V.B Apr 10 '13 at 12:01