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 the Mode of a single value returns that value or a NULL value, as described below:
    • IsRemovable=True returns the single value as the result of the Mode function. For example, Mode<IsRemovable=True>(4) would return the value 4.
    • IsRemovable=False returns a NULL value as the results of the Mode function when a single value is supplied. For example, Mode<IsRemovable=False>(4) would return NULL.

      If multiple values are supplied to the Mode function, the IsRemovable parameter has no effect on the result of the Mode 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.