hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sameer Kalburgi <sameerkalbu...@gmail.com>
Subject Percent Rank Calculation
Date Tue, 01 Mar 2011 20:51:11 GMT
Hello,

Does anyone have any experience calculating the percentile / percentrank for
each row in a table?

I see that there are built in UDAFs to calculate the percentile, but that
would only return a single value for the entire table.

Essentially, I'm trying to recreate the Excel PercentRank function described
here: http://msdn.microsoft.com/en-us/library/bb239448(v=office.12).aspx

For example, the input:

Score
--------
10
20
30
40
50

would yield

PercentRank
------------------
0.0
0.25
0.5
0.75
1.0

Any ideas?

Thanks,
Sameer

Mime
View raw message