User defined domain aggregate functions

  • Thread starter Thread starter k2sarah
  • Start date Start date
K

k2sarah

i would like to create a user defined domain aggregate function such as
calculate the median of a series. ( i would like to be able to do this
without calling on excel)can you tell me how to do this. also, can i
calculate the query by using the query designer. thks
 
Is the median the most frequently occuring value?

If so, you could write a function that gets the COUNT of each value, and
returns the highest count.

There's an example of how to OpenRecordset and use COUNT in a query in the
code at the end of this article:
http://allenbrowne.com/ser-66.html
The example is in the ELSE block.
 
Is the median the most frequently occuring value?

That would be the Mode not the Median... The median is that value for which
half the values are larger and half smaller; or more precisely, for an odd
number of values the value for which there are equal numbers of greater and
lesser values; for an even number of values, it is usually the mean of the two
values at the middle of the ranking. I'm not sure how ties are generally
handled!

The question has turned up pretty often (345 hits on a Google Groups search);
one of many solutions can be found at

http://www.fabalou.com/Access/Modules/recordset_median.asp


John W. Vinson [MVP]
 
Back
Top