SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Median by month in a matrix


Median by month in a matrix

Author
Message
tranzit5
tranzit5
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 5
I am querying a database that holds the length of time an event took and what I am trying to achieve is to be able to record the average, maximum and the median of these times in a matrix table grouped by the month the event took place.

The average and maximum are fine as they are built in functions but as I am using 2008 there isn't a built in function for the median. I have found some custom code that correctly reports the median but it only reports the median for the whole period not the individual grouped months.

Could any provide me with some code or point me in the direction of some useful guides as I have struggled to find what I am after but it may be the words I am using in my searches.

Many thanks.
Ray M
Ray M
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2169 Visits: 1076
Something to try. I've never found median to be a very meaningful number. Anyhoo. Hehe
http://techfilth.blogspot.com/2008/07/calculate-median-on-group-in-ssrs.html
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search