In some business scenarios, it is required to compare the metric value with previous quarter's.
The technical note as below provides a method with using MovingSum() function and basic math operation.
KB5504: How to create a derived metric that shows data from the previous row in MicroStrategy SQL Generation Engine
Another way to achieve this is using Lag() function. The Lag function is useful to display a set of metric values in an order determined by another metric or attribute on the report. It helps to compare metric values side-by-side. It is defined as
Sample Code/Error
Lag <BreakBy, SortBy> (Argument, Offset, DefaultValue)
EXAMPLE:

