We have many calculations following this basic pattern - take recorded values of one attribute, apply a filter (using FilterData), then retrieve values of a second attribute at the filtered timestamps of the first attribute.
Currently, we cannot retrieve the second attribute's values via bulk call because the "In" operator does not work with arrays (see screenshot for demonstration).
The workaround method we use is as follows. This does not use a bulk call.
Att1Values := RecordedValues('Attribute1', start, end)
Att1Filtered := FilterData(Att1Values, $val > 60)
Att2Values := MapData(Att1Filtered, TagVal('Attribute2', Timestamp($val)))
Using the "In" operator with arrays would allow a bulk call of Attribute2 values, which would improve performance:
Att1Values := RecordedValues('Attribute1', start, end)
Att1Filtered := FilterData(Att1Values, $val > 60)
Att1FilteredTS := MapData(Att1Filtered, Timestamp($val))
Att2Values := RecordedValues('Attribute2', start, end)
Att2Filtered := FilterData(Att2Values, Timestamp($val) in Att1FilteredTS)