Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

DBCalc - Median

edited May 2010 in General
Using RB Enterprise 11.08, Delphi 2006. I have a DBCalc field that I was
using a calctype of dcAverage, but now I need to get the median. I know
there's not a dcMedian, but is there an easy way to figure the median in
this field?

Thanks,

David

Comments

  • edited May 2010
    Hi David,

    The DBCalc component is only designed to make the calculations available.
    To find the median, I would recommend that you use the OnCalc event of a
    TppVariable set to calculate on Traversal. Each time the event fires, you
    could add to a list of values, then determine the median once the list has
    been compiled.

    The easiest way of course is to make this calculation in SQL in your
    database.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.