MicroStrategy ONE
Mode
Returns the most frequently occurring value in a given list. This is a group-value function.
Syntax
Mode <FactID, IsRemovable>(
Argument
)
Where:
FactID
is a parameter that forces a calculation to take place on a fact table that contains the selected fact.IsRemovable
is a parameter that determines whether theMode
of a single value returns that value or aNULL
value, as described below:IsRemovable=True
returns the single value as the result of theMode
function. For example,Mode<IsRemovable=True>(4)
would return the value4
.IsRemovable=False
returns aNULL
value as the results of theMode
function when a single value is supplied. For example,Mode<IsRemovable=False>(4)
would returnNULL
.If multiple values are supplied to the
Mode
function, theIsRemovable
parameter has no effect on the result of theMode
function.
Argument
is an attribute, fact, or metric representing a list of numbers.
Usage Notes
- This function provides a location measure: the value returned has a relative position with regard to other values in the list. Median is another function that provides a location measure.
- Returns a NULL if there are no recurring values in the range or list.
Example
This example shows a report that retrieves the mode of the unit cost for items in a subcategory. The report returns the most frequently repeated unit cost within the various subcategories, and, in the cases of Electronics, TVs, and Video Equipment, it returns a NULL value, because there are no recurring unit cost values for them. The report contains the attributes Category and Subcategory, and the metric Mode Unit Cost. A report filter limits the categories displayed to Books and Electronics. The Mode Unit Cost metric is defined as follows:
Mode([Unit Cost])
The formula listed above uses the Unit Cost fact rather than the Unit Cost metric.