A question came up recently that I thought would be of wider interest: how can I prevent interpolation across batch/capsule boundaries?
In batch processes, lab samples are often taken periodically throughout the course of a batch. When viewing these samples in Seeq, you may encounter times when samples are interpolating between batches rather than just within a batch. In the image below, the periods highlighted in yellow correspond to this unwanted interpolation.
The following formula is one way of preventing this interpolation. $signal corresponds to your signal of interest and $condition corresponds to your batches you want to prevent interpolation across.
combineWith(
$signal,
Scalar.Invalid.toSignal().aggregate(startValue(),
$condition.removeLongerThan(40h),
startKey())
)
This results in the following signal that has our desired behavior: