MapData
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Apply a function to each value in an array.
Syntax
MapData(a1, function($val))
Arguments
-
a1
a variable representing the array to operate on
-
function($val)
any supported PE statement, as a function of $val, that performs an operation. $val is a placeholder for each value in the array
Returns
The transformed array of all the values
Exceptions
None
Notes
The output array has the same timestamps as the input array.
Example
-
MapData(Data, (IF BadVal($val) THEN 0 ELSE $val))
[From an array named Data, return a new array with bad values set to 0]