Archives of the TeradataForum
Message Posted: Fri, 22 Feb 2002 @ 18:27:40 GMT
Subj: | | Re: PERCENT_RANK |
|
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!
JC
|