MicroStrategy ONE
LastInRange
Returns the last value in a range of values. LastInRange can be used to examine data such as inventory at the end of each month.
Calculations can be restarted based on attributes set in the function parameters. This restart capability differentiates LastInRange from Last. While Last is a group-value function and takes both facts and metrics as argument input, LastInRange is an OLAP function and takes only metrics as argument input.
Syntax
LastInRange <BreakBy={}, SortBy=()> (Argument)
Where:
BreakByis the attribute indicating where the calculation restarts.SortByis the attribute or metric by which the data is sorted.Argumentis a metric representing a list of numbers.
Expression
Where:
k= row numberyk= last non-NULL value of the metric after applying theBreakByandSortByparameters
