16.20 - Median Absolute Deviation (MAD) - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantageā„¢ Time Series Tables and Operations

Teradata Database
Teradata Vantage NewSQL Engine
Release Number
Release Date
March 2019
Content Type
Programming Reference
Publication ID
English (United States)


Returns the median of the set of values defined as the absolute value of the difference between each value and the median of all values in each group.

MAD is a single-threaded function.

To invoke this function, use the GROUP BY TIME clause. For more information, see GROUP BY TIME Clause.


Syntax Elements

A Teradata Database literal numeric constant.
A literal or column expression for which to compute a median absolute deviation.

The value_expression cannot be a reference to a view column derived from a function, and cannot contain any ordered analytical or aggregate functions.

Return Value

This function returns the REAL data type.

Nulls are not included in the result computation.

Usage Notes

The formula for computing MAD:

If the constant_multiplier is not provided, it uses 1.4826 as the default.

MAD is valid only for numeric data.