September 22, 2011 at 4:53 am
Hi
resonably new to SQL and even newer to BIDS
I have been searching for a solution for this now for many days.
i have a dataset which i need to produce a graph in BIDS to show the median for values by month.
I have struggled to find a suitable function script in SQL that gives me the resulst i would expect.
Does anyone know of a way i can do this in BIDS or am I better of doing the calc/function in the SQL script.
I am basing my resulst on the way EXCEL calculates median, by which i mean it will look for half way between 2 values when the dataset contains an even number if items. (i think the techi term is interpolation)
I do have a sample file of data if you require in CSV format which can be imported into SQl server if you need it.
Thanks in advance
September 23, 2011 at 7:06 am
There isn't an out-of-the-box function for that, but this blog posts suggests an implementation:
http://sqlblog.com/blogs/adam_machanic/archive/2006/12/18/medians-row-numbers-and-performance.aspx
But it seems the next version of SQL Server, code named Denali, will have something that resembles a median() funtion:
https://connect.microsoft.com/SQLServer/feedback/details/344916/add-median-function-to-sql-server
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
September 30, 2011 at 6:44 am
Did you search here? Here's a post on computing medians.
Rich
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply