Archives of the TeradataForum
Message Posted: Fri, 22 Feb 2002 @ 18:27:40 GMT
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!
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|