42
MicroStrategy Functions Reference
Standard Functions
2
© 2011 MicroStrategy, Inc.
OLAP functions
157
The Cost (Lag on Profit) values are displayed three behind the Cost metric,
and are displayed based on the descending sort order of Profit. Notice that
with an offset of three, the first three entries for Cost (Lag on Profit) use the
default value of zero. Also, the last three values of Cost are not included in
the Cost (Lag on Profit) metric.
The report has been sorted based on the Profit metric to make the Cost (Lag
on Profit) values easier to analyze.
Transformation-style analysis using the Lag and Lead
functions
Transformation-style analysis can be supported using the Lag and Lead
functions provided with MicroStrategy. These functions can be used to
define metrics that compare values from different time periods without the
use of transformations. For information on creating transformations, see the
Project Design Guide.
Note the following:
• The examples shown below were created in the MicroStrategy
Tutorial project.
• The examples below use the Lag function. The Lead function can
be used in the same way. The difference in using Lead rather than
Lag is that the Lead function would display information by going
forward in time rather than backward. For example, while the Lag
function can return historical data from one year ago, the same
formula used for the Lead function would return historical data
from one year ahead.
The Lead function does not predict future values. For functions
that can predict future values based on historical data, see
ForecastV (forecast, vector input), page 348, GrowthV (growth,
vector input), page 353, and TrendV (trend, vector input),
page 380. Additionally, you can use data mining functions from
MicroStrategy Data Mining Services to predict future trends, as
described in Data mining functions, page 258.
For example, a Last Year’s Monthly Revenue metric can be created using the
following function:
Lag<SortBy=(Month@ID)>(Revenue,12,
ZeroToNull(0))