QUANTILE Function Syntax | VantageCloud Lake - QUANTILE Function Syntax - Teradata VantageCloud Lake

Lake - Working with SQL

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
jbe1714339405530.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
jbe1714339405530
QUANTILE ( quantile_literal, sort_spec [,...] )

Syntax Elements

quantile_literal
A positive integer literal used to define the number of quantile partitions to be used.
Quantile values range from 0 through (Q-1), where Q is the number of quantile partitions specified by quantile_literal.
sort_spec
sort_expression [ ASC | DESC ]
sort_expression
A literal or column expression or comma-separated list of literal or column expressions to be used to sort the values.
For each row in the group, QUANTILE returns an integer value that represents the quantile of the sort_expression value for that row relative to the sort_expression value for all the rows in the group.
ASC
Ascending sort order.
DESC
Descending sort order.