MicroStrategy ONE

Lead

The Lead function is useful to display a set of metric values in an order determined by another metric or attribute on the report. This allows you to compare metric values side-by-side. The easiest way to understand the Lead function is with an example, which one is provided below.

Syntax

Lead <BreakBy, SortBy> (Argument,Offset, DefaultValue)

where

  • BreakBy is the attribute indicating where the calculation restarts.

  • SortBy is the attribute or metric by which the data is sorted.

  • Argument is an attribute or metric representing a list of values. It is common to use a metric for Argument.

  • Offset specifies the offset from the current row to display information for. This offset precedes ahead of the current row (you can use the Lag function to use an offset that trails behind the current row). For example, with an offset of two, row one displays data for the row two ahead of it, which would be row three.

  • DefaultValue is the value displayed for any entries that do not have any data due to the offset. For example, when using an offset of two, the last two entries use the default value.

    It is common to enter a value of 0 or NULL for the DefaultValue.

For additional information on and an example of this function, refer to the MicroStrategy Functions Reference. This resource also includes an example of using the Lag and Lead functions to perform transformation-style analysis.