MicroStrategy ONE
IF
Returns a value if the specified condition is TRUE
; otherwise, a default value is returned. This is a single value function.
Syntax
IF (
Condition
,
TrueBranch
,
FalseBranch
)
In this guide, lists of attributes, metrics, values, parameters, etc. within a function are separated by commas. Your separator may vary depending on your number and date format locale. For example, the separator is a comma (,) in English and a semicolon (;) in German.
Where:
Condition
is the conditional expression. The condition can contain metrics, comparison and logical operations, and constants. The condition must be evaluated to beTRUE
orFALSE
.TrueBranch
is a constant or metric value to return if the condition isTRUE
.FalseBranch
is a constant or metric value to return if the condition isFALSE
.
Usage Notes
FalseBranch must be provided; otherwise the return value is undefined.
Example
A metric is defined as:
IF ((Total Revenue < 300000), 0, 1)
This metric returns 0 if the Total Revenue is less than 300,000; otherwise, it returns 1.