How can the median of a column of data be calculated in MapInfo Professional?
Question: The median value is not one of the aggregate functions provided with MapInfo Professional. Here’s an Internet definition of “median”: The median of an ordered list is the middle value if the number of elements is odd. If the number of elements is even, then the median is the average of the two middle values. The mean (average) depends on the distribution. If the distribution is either positively or negatively skewed, then the median will not equal the mean. ——————————————————— It’s easy enough to calculate the median in a MapBasic program, or even in a series of SQL-type statements: Select (column) from (table) Order By (column) into Temp Look at the status bar for the resulting browser window. If the number of records is even, do: Select Avg({column}) “Median” from Temp where RowID={number of records}/2 or RowID={number of records}/2+1 Into MedianFinal If the number of records is odd, do: Select ({column}) “Median” from Temp where RowID=