cancel
Showing results for 
Search instead for 
Did you mean: 

Percentile Calculation within HANA?

Former Member
0 Kudos

Hi All,

One of my requirements is to return a specified Percentile so I need a percentile calculation function for HANA.

In order to do this, I need to rank the data records by the specified value. It is then expected a user will enter in a percentile and only the value within that percentile is returned for the data record.

Below is an example of the logic and how this applies to the data.

The following raw data records are give, we need to get the 80% percentile:

ID                           Name                   Amount

1                              Joe                         100

1                              Jane                       30

1                              David                     200

1                              John                      10

1                              Scott                      50

Step 1: rank data records

ID                             Name                 Amount

1                              John                      10

1                              Jane                       30

1                              Scott                      50

1                              Joe                         100

1                              David                     200

Step 2: return record 80% percentile value.

In this case the 80% percentile value for ID 1 is 120

As far as I know, there are no standard ranking function in HANA. Do I need to use CE function to generate this logic – or is there a better method to do this?

How should I go about doing the percentile calculation?

Thanks for your help, any guidance will be appreciated.

View Entire Topic
sorin_radulescu
Employee
Employee
0 Kudos

You have percentile function in HANA.

PERCENTILE_DISC and PERCENTILE_CONT.

Check the follow link for more details

https://help.sap.com/viewer/7c78579ce9b14a669c1f3295b0d8ca16/Cloud/en-US/d8394326f65e4fd9aa5a9750755...