MicroStrategy ONE
First
Returns the result of an aggregate applied over a set of rows that ranks as the first within a specified order. This is a group-value function that shares the sort by capability of the OLAP functions.
Syntax
First<FactID, SortBy>(
Argument
)
Where:
Argument
is an attribute, fact, or metric representing a list of values.FactID
is a parameter that forces a calculation to take place on a fact table that contains the selected fact.SortBy
is a parameter that allows you to define the attribute or metric on which to sort the data.
Example
The First function is often used to define subtotals. In this example, the First function defines the subtotal for the metric units received, returning the units received for the first quarter containing a value in 2003. The expression defines the subtotal as follows:
First<SortBy= (Day, Month, Quarter, Year) >([Units Received]){@}
Argument is the metric to which the subtotal is applied.
For detailed instructions on creating and applying user-defined subtotals, see the MicroStrategy Advanced Reporting Guide.