0

I have a C# program that generates a report (designed using the Report Design wizard) that looks like this:

expanded report

It has six columns: BILLMOYR, MBRSEP, LOCATION, RATE, BILLTYPE, DISTRICT.

At the bottom of this report, I have an expression that looks like this:

[CountDistinct(MBRSEP)]

This tells me the total number of unique MBRSEPs in my report.

What I'd also like to do is get the total number of unique MBRSEPs for each DISTRICT. Can I add something to the report like this?:

[CountDistinct(MBRSEP where DISTRICT = '13')]
[CountDistinct(MBRSEP where DISTRICT = '14')]

etc...? Does something like that exist for the CountDistinct function?

Kevin
  • 4,798
  • 19
  • 73
  • 120

1 Answers1

1

This is very simple in RS. You simply create a grouping for MBRSEP and in the group footer you can leave COUNTDISTINCT(MBRSEP). You are using reporting services correct? This will give you a count per each group.

JonH
  • 32,732
  • 12
  • 87
  • 145
  • I actually designed the report in the Visual Studio 2010 Report designer wizard. I'm not very familiar with these type of reports, so I'm learning as I go along. As far as creating a MBRSEP 'grouping', I'll investigate how to do that and see if it helps me determine the unique MBRSEPS by DISTRICT. – Kevin Feb 29 '12 at 19:10
  • @Kevin - here is an example of creating a group within the report http://stackoverflow.com/questions/8389884/how-do-you-create-a-report-rdlc-that-shows-1-record-per-page/8390250#8390250 – JonH Feb 29 '12 at 19:32