This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 18155
    
    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: 36590
    
  16
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
 
Similar Threads
Function Point
SCJP tomorrow! Any study suggestions?
Passed SCJP 6 - 90%, bad aftertaste
Is my prof trolling me? (factorials, loops)
program calculating the mode