SQL for Quantile Function in Teradata

A Quantile is used to divide rows into a number of categories or grouping of roughly the same number of rows in each group. The percentile is the QUANTILE most commonly used in business. This means that the request is based on a value of 100 for the number of partitions

SELECT Product_ID1, Sales_Date1, Daily_Sales1
,QUANTILE(100, Daily_Sales1 ) AS "Quantile1"
FROM Sales_Table
WHERE Product_ID1 < 3000
AND Sales_Date1 > 1000930 ;

The calculation is percentile for every row in the Sales table on Daily sales.

Post a Comment

0 Comments