Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java code for calculating 95 percentile

 
Ashu Bharadwaj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general I would say you should do the calculation in the database if it's possible.
 
Ashu Bharadwaj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul for your reply.
 
Ashu Bharadwaj
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please provide algorithm for calculating 95th percentile
 
Campbell Ritchie
Sheriff
Pie
Posts: 49789
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic