Percentile (Teradata Database) - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Product
Teradata Warehouse Miner
Release Number
5.4.6
Published
November 2018
Language
English (United States)
Last Update
2018-12-07
dita:mapPath
gxn1538171534877.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2301
Product Category
Software

This function is only available when connected to a Teradata database.

Given a value expression, typically involving one or more columns, and a sort expression list, the Percentile function computes the value or interpolation of a value such that a given percentage of rows have a value less than or equal to that value. The rows considered are either all the rows in the query or just the rows in a group defined by a GROUP BY clause. There are actually two different Percentile functions, PERCENTILE_CONT, which returns an interpolated or “continuous” value, and PERCENTILE_DISC, which returns a “discontinuous” value that occurs in the data set.

Percentile is an aggregate function with NULL values ignored. Note that Median is a special case of PERCENTILE_CONT with an argument value of 0.5.

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

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

Double-click on Percentile, or highlight it and click Properties to set the properties for this function.

Variable Creation > Input > Variables: SQL Elements pane - Ordered Analytical Functions > Percentile Properties

By selecting Continuous (the default value), a PERCENTILE_CONT function is requested. By selecting Discontinuous, a PERCENTILE_DISC function is requested.