File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC 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
JavaRanch » Java Forums » Databases » JDBC
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
Bartender

Joined: Oct 14, 2005
Posts: 18563
    
    8

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: 38729
    
  23
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java code for calculating 95 percentile