LastValue
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
Get the last value in an array that satisfies a given condition.
Syntax
LastValue(a1 [, condition($val)])
Arguments
-
a1
a variable representing the array to operate on
-
condition($val)
any supported PE statement, as a function of $val, that returns a true or false. $val is a placeholder for each value in the array
Returns
The last value that satisfies the given condition
Exceptions
None
Notes
None
Example
-
LastValue(Data)
[Return the last value from an array named Data]
-
LastValue(Data, $val > 90 and $val < 105)
[From the array named Data, return the last value in the array that is greater than 90 and less than 105]