Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Min and Max of a Count based on a grouping

$
0
0

I have scoured the tubes and found nothing on this, and none of my coworkers had any idea, and I've been plugging at this for a few weeks, with no luck. I dont even know if this is possible in SSRS, and it probably is with a complex query, but I dont know where to begin on it.

 

I have a count of appointment numbers that are grouped on Doors that trailers enter and exit. Each  appointment, finished or not is counted in this way.

 

Now, I need to get a max, average, and minimum based on these doors. None of these functions are helpful at all with this, as I'm doing a COUNT on appointment numbers on these doors.

For example

Door 1    5

Door 2    1

Door 3    1

Grouping these based on the name of the door does help for this situation, but not for Max/Min/Avg, as Max/Min gives 5 if grouped by name, and AVG does an average of 7/3 if grouped by name column.

 

I cant do a RunningValue, which would be perfect, since I need a minimum/max/avg, and this is all done at runtime based on user selected parameters based on states of the appointments, so i have no clue if a query would help.

 

My expressions:

MAX:Max(CountDistinct(Fields!AppointmentNumber.Value))

AVG: Round(Count(Fields!AppointmentNumber.Value)/ Sum(CountDistinct(Fields!name.Value)),2)

MIN: Min(CountDistinct(Fields!AppointmentNumber.Value))

 

Any help is appreciated. I can provide more info if needed. Thanks!


Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>