40
Understanding Functions in MicroStrategy
MicroStrategy Functions Reference
1
24
Using functions in expressions
© 2011 MicroStrategy, Inc.
About arguments
Arguments are the input data used in the calculation of a function.
Arguments can be numbers, text, or logical values (such as TRUE or FALSE)
as well as constants (such as NULL). They can be lists of values or variables
referencing lists of values. Arguments in MicroStrategy are most often
references to lists of values. In function syntax, the arguments are enclosed
in parentheses (). If the argument is a reference to a MicroStrategy object,
and the object name is alphanumeric or contains multiple words, it is also
contained in brackets [ ]. Depending on the function selected and the object
being created, in a MicroStrategy environment the input could comprise one
or more of the following objects:
• Attributes: Attributes are most often used to group fact data. They are
included in reports to define the level of detail. Typically non-numeric,
some common examples of attributes are Year, Category, and Region.
• Facts: Facts are the most commonly used input for metrics. They are
numerical lists obtained from specific columns in a fact table. Examples
of facts include Units Sold, Units Received, and Discount.
• Metrics: Metrics represent calculations performed on data and can
themselves be used as input for further calculation by a function.
Examples of metrics include Percent Growth, Profit Margin, and
Sell-through Percentage.
• Columns: Column data is used when creating attribute form expressions
and fact expressions. The expressions for these objects define how
column data is retrieved from the warehouse. Examples of columns
include TOT_DOLLAR_SALES, TOT_COST and CUST_CITY_ID.
For an in-depth discussion of attributes, facts, and metrics, refer to
the MicroStrategy Advanced Reporting Guide.
Using functions in expressions
Functions are the basis for many MicroStrategy objects. They are used to
create:
• Metric expressions
• Attribute form expressions
• Consolidation expressions