Thursday, 19 February 2015

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.

No comments:

Post a Comment

5 Top Teradata DATE functions read now

  The following are the list of DATE functions. These are very frequently being used in Teradata. Current DATE The following statem...