MicroStrategy ONE

OLAPRank

Returns the rank of the current value based on the other values defined by the sorting criteria. The ranking can be restarted based on attributes defined in the function parameters.

The OLAPRank function allows the ranking to be calculated in the database, rather calculating the ranking using the MicroStrategy Analytical Engine.

Be aware of the following:

  • Since OLAPRank is calculated in the database, you can only use this function if your database supports the OLAPRank function.

  • Any metrics that use the OLAPRank function must not be defined as smart metrics. If metrics that use OLAPRank are defined as smart metrics, the calculation is performed in the MicroStrategy Analytical Engine and an error is returned.

  • You must include at least one metric in the SortBy parameter.

Syntax

OLAPRank<BreakBy, SortBy>()

where

  • BreakBy is the attribute indicating where the ranking restarts.

  • SortBy is the attribute or metric by which the data is sorted. For OLAPRank, the SortBy parameter is also where you can include the metric to perform the calculation on. You must include at least one metric in the SortBy parameter.

For additional information on and an example of this function, refer to the MicroStrategy Functions Reference.