If
Description
If returns one value when a condition is true and another value when it is false.
Syntax
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
condition |
Yes | Boolean expression | Condition to evaluate. |
value_if_true |
Yes | Any | Value returned when the condition is true. |
value_if_false |
Yes | Any | Value returned when the condition is false. |
Notes
Use this function in calculated fields, metric expressions, or query expressions where the function category is supported.
Example
The expression returns the calculated result according to the current query context.