Median - Teradata Warehouse Miner

Teradata Warehouse Miner User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.4
Published
July 2017
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
fcf1492702067123.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

Given a value expression, typically involving one or more columns, MEDIAN computes the median value of the value expression over all the rows in the query or over all the rows in a group of rows determined by a GROUP BY clause. Very loosely, the median value is the “middle” value in a set of values such that a nearly equal number of values are less than and greater than the median value. When there is an even number of values in the set of values, linear interpolation is used on the two “middle” values to determine the median.

Median is an aggregate function with NULL values ignored.

MEDIAN(expression)

is the same as:

PERCENTILE_CONT (0.5) WITHIN GROUP ORDER BY (expression)

When dragging a Median function into a variable, the following tree element is created.

Variable Creation > Input > Variables: SQL Elements pane – Ordered Analytical Functions > Median

There are no special properties associated with the Median function.