views:

114

answers:

1

I have a report where I'm counting the number of records for a day. At the bottom, I have the total records for that time period. I'd like to display the average records for each day. An example:

alt text

I can accomplish this by aggregating the data by date in SQL then just doing the Average and Sum of the count from SQL, but that would complicate the report considerably as I'm doing other column filters for the types of tests performed. There seems to be a simple way to accomplish this that I'm missing. I can't do Average(Count(field)) in SSRS, unfortunately.

Is there something I'm missing, or is there really not a way to accomplish this simply?

A: 

I'm missing something here....

Surely you just want the avg function? Why do you need to count?

RS knows the scope of what you are trying to average, so it knows what to divide the total by.

adolf garlic
The table in the OP was what I want the end result to look like, not what my data looks like. My data will have 5 rows corresponding Jan 1, 10 rows corresponding to Jan 2, and 8 rows corresponding to Jan 3. I could add a static column of 1 for each row then sum that instead of doing a count. If I then average that, I would get an average of 1. I need to average of the number of rows that correspond to a particular day.
Tim Coker
Then I think what you are after is a weighted average. http://www.experts-exchange.com/Web_Development/Miscellaneous/Q_21232907.html just scroll down past all the "subscribe now" crap and you'll see that you don't need to join experts-exchange to see the answers after all
adolf garlic
Tim Coker