SampleFilter()

Format

SampleFilter(TimeString,Condition)

Returns

Returns samples in the first argument only where the condition evaluates to true.

Inputs

TimeString: The time expressed as a string.
Behaviour: Required
Dimension: Collection, SingleValue
Valid data types: Null, Boolean, DateTime, Decimal, Integer, String, Duration

Condition: The condition being evaluated.
Behaviour: Required
Dimension: Collection, SingleValue
Valid data types: Null, Boolean, DateTime, Decimal, Integer, String, Duration

Note: You can use the Time() function to use a valid DateTime argument.

It is possible to retrieve very large volumes of data through indiscriminate use of this function. Retrieving large amounts of Historian data across a slow network can affect system performance for all users of the system

Examples

This is most commonly used with historical functions such as Sum_Sampled(),  Average_Sampled(), and so on. For example, the average of all values of X when Y is greater than 10, since midnight:

Average_Sampled(SampleFilter(X, Y > 10), Midnight(Time()))

 

Comments are closed