Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2024 R2)

FirstValue

  • Last UpdatedJan 11, 2023
  • 1 minute read

Get the first value in an array that satisfies a given condition.

Syntax

FirstValue(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 first value that satisfies the given condition

Exceptions

None

Notes

None

Example

  • FirstValue(Data)

    [Return the first value from an array named Data]

  • FirstVal(Data, $val < 90)

    [From the array named Data, return the first value in the array that is less than 90]

In This Topic
TitleResults for “How to create a CRG?”Also Available in