12

I have a report that displays names of all accounts and activities performed under each of them.

AccountName: ABC Corp Activity: Installation

I want to group the AccountName and get the total number of Activities performed for each account.

ABC Corp: 1

How can I accomplish this in SSRS 2008? I am able to group the AccountName but I need a way to convert the Activity column to int so I can get the total.

Help appreciated!

user2287143
  • 231
  • 2
  • 4
  • 11
  • The grouping worked fine in the development instance but broke in production. Again, to specify the problem: – user2287143 May 02 '13 at 15:17
  • The grouping worked fine in the development instance but broke in production. Again, to specify the problem: I need to run a report to show the total number of activities performed by resources on each account. I grouped the Account column and put in this expression in the expression field: CountRows("Account"). This gave me the total number of Activities for that Account. Now, I have the total number value in the Account column and names of Activities in the Activity column. I simply changed the column name to Activity Total. This is the column that contained number of activities. Not working – user2287143 May 02 '13 at 15:24

2 Answers2

28

You can add a total row for the Account group and give your total field the expression CountRows("AccountGroupName"), to count the Activity detail rows for each Account group.

You can also put the total value at the level of the group row / group header.

More details about Function CountRows could be found here: http://msdn.microsoft.com/en-us/library/ms156330(v=sql.100).aspx

amartine
  • 819
  • 1
  • 10
  • 24
5

You can put CountRows() in an expression within a group and it will show the row count for each grouping.

Justin Ipson
  • 481
  • 9
  • 6