IF
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Operator that introduces the condition in IF-THEN-ELSE statement. Return the first of two specified values if the conditional expression is true. Otherwise, return the second value.
Syntax
IF (expression) THEN (x) ELSE (y)
Arguments
-
expression
Any expression that evaluates to true or false
-
x, y
An expression that evaluates to an output value
Returns
x when the conditional expression is true and y when the expression is false
Exceptions
None
Example
-
IF ('att1' > 50) THEN ('att2') ELSE ('att3')
[If the value of 'att1' is greater than 50, then return 'the value of 'att2'; otherwise return the value of 'att3']