Percentiles Example - Teradata Vantage

Machine Learning Engine Analytic Function Reference

Product
Teradata Vantage
Release Number
8.00
1.0
Published
May 2019
Language
English (United States)
Last Update
2019-11-22
dita:mapPath
blj1506016597986.ditamap
dita:ditavalPath
blj1506016597986.ditaval
dita:id
B700-4003
lifecycle
previous
Product Category
Teradata Vantageā„¢

Input

The input table, london_olympics, contains the age, height, weight, sex, sport and country for a subset of the participants in the 2012 Summer Olympics.

london_olympics
name country age height weight sex sport
Adriatik Hoxha Albania 22 194 130 M Athletics
Arben Kucana Albania 44 184 95 M Shooting
Briken Calja Albania 22 169 69 M Weightlifting
Daniel Godelli Albania 20 168 68 M Weightlifting
Endri Karina Albania 23 186 94 M Weightlifting
Klodiana Shala Albania 32     F Athletics
Majlinda Kelmendi Albania 21   51 F Judo
Noel Borshi Albania 16 164 54 F Swimming
Romela Begaj Albania 25 160 58 F Weightlifting
Sidni Hoxha Albania 20 193 86 M Swimming
Ali Hasan Mahboob Bahrain 30 175 70 M Athletics
... ... ... ... ... ... ...

SQL Call

SELECT * FROM Percentiles (
  ON london_olympics PARTITION BY country
  USING
  Percentile (0, 100)
  TargetColumns ('height', 'weight', 'age')
  GroupColumns ('country')
) AS dt ORDER BY 1,2;

Output

The output table displays the values for each target column, partitioned by country, corresponding to the requested percentiles.

country percentile height weight age
Albania 0 160 51 16
Albania 100 194 130 44
Bahrain 0 162 43 15
Bahrain 100 175 72 30
Costa Rica 0 163 50 21
Costa Rica 100 195 96 32
Cyprus 0 162 55 16
Cyprus 100 193 110 37
El Salvador 0 159 54 19
El Salvador 100 185 80 29
Eritrea 0 160 51 18
Eritrea 100 188 71 34
Grenada 0 162 56 19
Grenada 100 187 75 32
... ... ... ... ...