This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Java code for calculating 95 percentile Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Java code for calculating 95 percentile" Watch "Java code for calculating 95 percentile" New topic
Author

Java code for calculating 95 percentile

Ashu Bharadwaj
Greenhorn

Joined: Nov 16, 2010
Posts: 20
Hi,

Which is the best solution for calculating 95th Percentile: calculating in Java code or in SQL. Need efficient way. The input file is large.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

In general I would say you should do the calculation in the database if it's possible.
Ashu Bharadwaj
Greenhorn

Joined: Nov 16, 2010
Posts: 20
Thanks Paul for your reply.
Ashu Bharadwaj
Greenhorn

Joined: Nov 16, 2010
Posts: 20
Can you please provide algorithm for calculating 95th percentile
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43392
    
  32
Ashu Bharadwaj wrote:Can you please provide algorithm for calculating 95th percentile
No. We do not know how your data are organised, so how should we know how to calculate the 95th centile? Can’t you order the data, count them, and then iterate the data to 95% of the count?
 
jQuery in Action, 3rd edition
 
subject: Java code for calculating 95 percentile
 
It's not a secret anymore!