Skip to Content
author's profile photo Former Member
Former Member

How to calculate percentile in HANA?

Hi,

I'm struggling to find a function in SAP HANA that can be used to create a percentile. I'm looking for something similar to the percentile_desc function in oracle that can create a percentile based on a certain subsets of the data.

What I'm exactly looking for:

Example, I have a table with 2 fields country & population of each state within that country

Need to find out the 99th percentile of population (within each country) and impute any value > than that to the 99th percentile.

Any help will be appreciated!

Thanks,


Vignesh

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 30, 2012 at 08:15 PM

    Can you give a concrete example of what you want to compute?

    US CA 100

    US MI 90

    do you need 3 columns?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I did not see any function in SQL layer can do this.

      But using pal libary (predictive analysis libary) come with HANA, you may be able to achive that.

      Or you can write a LL language function to compute that. I am not sure the LL language is public available or not.

  • author's profile photo Former Member
    Former Member
    Posted on Nov 09, 2012 at 10:00 PM

    Hi Vignesh,

    You can try to integrate R Language with your HANA instance, create a procedure using R Language and use quantile function in R programming language.

    You can refer to the following guide (and sample procedure code) for HANA Development Guide - Integration with R programming language:

    http://help.sap.com/hana/hana_dev_r_emb_en.pdf

    Regards,

    Ferry

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.