Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 22 Feb 2002 @ 18:27:40 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

From:   JC Sheu

I am not aware of "PERCENT_RANK" function. But if you are trying to rank something by percentile (or quantile or any other number of segments), you can use the "QUANTILE" function. For example:

SELECT    customer_ID
         ,QUANTILE(100, customer_revenue)

FROM ...

will return customer ID and customer's revenue rank in percentile (0-99).

Remember to use "QUALIFY" instead of "HAVING" to filter out unwanted records.

Hope this will help!


  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020