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?
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.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com