MicroStrategy ONE

Metric Editor Formula tab: Functions and Operators

You can use functions and operators to define a metric formula. You can type them directly in the Formula definition pane, click an arithmetic operator on the operator bar in the Formula definition pane, use the Insert Function Wizard to guide you through defining a function's arguments and parameters, or use the Functions and Operators folder in the Shortcut Bar (labeled as My Shortcuts by default).

The Functions and Operators folder contains the subfolders Functions, Operators, and Plug-In Packages. Browse the folders to find the appropriate function to use in the metric, and double-click the function to add it to the Definition pane.

Functions

The functions are grouped in the following folders:

  • Basic Functions are basic mathematical functions like average, greatest, least, maximum, minimum, first, last, and so on. They are among the most commonly used functions when creating a calculation.

  • Date and Time Functions provide date and time information, such as current date, the day of the week of a particular date, and so on.

  • Internal Functions include banding functions, which are used to differentiate the data displayed on a report, and pass-through functions like ApplySimple.

  • Null/Zero Functions determine how nulls and zeros are displayed on a report.

  • OLAP Functions are relative functions, such as rank, running sum, moving average, and so on.

  • Rank and NTile Functions are very similar to OLAP functions in behavior. The primary difference is that in the Rank family <Sortby uses only metrics, not attributes.

  • String Functions work on text strings, performing tasks such as trimming and concatenating.

For details about the syntax and usage of each function, refer to the Functions Reference.

Plug-In Packages

You can also define your own functions using the MicroStrategy Function Plug-in Wizard. These functions are saved in the Plug-In Packages folder. For more information, see the Functions Reference .

Operators

Operators are grouped in the following folders:

  • Arithmetic Operators perform basic mathematical functions such as addition and subtraction.

  • Comparison Operators compare values, which can be numbers, text strings, or expressions.

  • Comparison Operators for Rank compare rank values only.

  • Logical Operators allow certain conditions to be applied to two sets of filter expressions simultaneously. The three basic logical operators are union, intersection, and exclusion.

Related Topics