Orders the set according to the numeric value expression, and then returns the value of the set's median tuple.
Syntax
Median ( set, numeric_value_expr )
Parameter | Description |
---|---|
set | The set from which to get a median tuple value. |
numeric_value_expr | A numeric value or an expression that returns a numeric value. |
Notes
This function is a special case of the Percentile function where n = 50.
Example
The following query returns the median price for radios paid in all states last year.
WITH MEMBER [Geography].[Median Mkt Price] AS 'Median ( [Geography].Levels(2).Members, [Measures].[Price Paid])' SELECT { [Geography].[Median Mkt Price]} ON COLUMNS FROM ASOSamp.Sample WHERE ([Products].[Radios], [Years].[Prev Year] )