Description
The IF function evaluates a condition and returns one value if the condition is TRUE and another value if the condition is FALSE.
Usage
The function is used to apply conditional logic in calculations.
Syntax:IF(condition, then, else)
Examples
-
Evaluate Status for a Result:
IF(#[Assessment Status] = "Effective", "Good", "Bad")Returns "Good" if the Assessment Status is "Effective"; otherwise, it returns "Bad".
-
Check if a Number is Greater Than One:
IF(LATEST(#[Actions].[Number]) > 1, true, false)Returns TRUE if the latest value in the Number field of the linked Actions record is greater than 1; otherwise, it returns FALSE.
-
Check if a Date is Blank:
IF(ISBLANK(#[Start Date]), false, true)Returns FALSE if the Start Date is blank; otherwise, it returns TRUE.
Inputs
| Argument | Data Type | Description |
|---|---|---|
| condition | Boolean | The condition to evaluate. |
| then | Any | The value to return if the condition is TRUE. |
| else | Any | The value to return if the condition is FALSE. |
Returns
Type: Any
- Returns the value specified for either the then or else condition.