MicroStrategy ONE
Median
Median
returns the value in the middle of a set of listed values. The result will be greater than half the values in the list and less than the other half. The median can be used as an alternative to the arithmetic mean when handling values that are not evenly distributed or contain outliers. This is a group-value function.
Syntax
Median <FactID>(
Argument
}
Where:
Argument
is an attribute, fact or metric representing a list of numbers.FactID
is a parameter that forces a calculation to take place on a fact table that contains the selected fact.
Usage Notes
This function provides a location measure: the value returned has a relative position with regard to other values in the list. Mode is another function that provides a location measure.
Example
This example shows a report built to obtain the median age of employees within each region. The report includes the attributes Region, Employee, and Employee Age, and the metric Median Age. A report filter limits the regions displayed to Mid Atlantic, Northeast, and Southeast. The metric Median Age is defined as follows:
Median([Employee Age){Region,~}
The function evaluates the list of employee ages within a region and selects a value in the middle of the value list.
For another example of using the Median function, see Example 2: Median.