Delta operator behavior in Mediation
The Delta operator in Zuora Mediation calculates how a numeric field changes over time, rather than just aggregating all values into a single total. It is typically used when the source field is a cumulative counter (such as a running meter reading) and you need to derive per-event or per-interval changes.
The Delta operator useful for usage metering, incremental billing, anomaly detection, and monitoring use cases. This operator is available as an option under the Aggregator and Accumulator processor meter components.
Conceptually, the operator computes:
Delta = Current value − Reference value
The exact choice of reference is determined by the Mediation component that uses Delta (for example, Aggregator or Accumulator) and how that component organizes and processes events.
Accumulator mode: Current − First
This version of the Delta operator is used when data is processed in batches, meaning all the data is collected first and then analyzed together, rather than being handled one record at a time in real-time. It is also applied when there's no specific time window defined.
The operator works by remembering the first value it sees and using that as a baseline. It also notes the time when this first value was recorded, and keeps updating the time as new records come in.
When the first record arrives, there is no earlier data to compare it to, so the calculated change, or delta, is set to zero. For each following record, the operator subtracts that original first value from the new one to show how much the value has changed since the beginning. For example, if the first value was 100 and the next value is 120, the delta would be 20, indicating a 20-unit increase from where things started.
Record | Value | Delta |
|---|---|---|
R1 | 100 | 0 |
R2 | 120 | 20 |
R3 | 130 | 30 |
Special case: Negative deltas
A delta can be negative when the current value is lower than the previous or starting value.
Record | Value | Delta |
|---|---|---|
R1 | 500 | 0 |
R2 | 520 | 20 |
R3 | 480 | -20 |
R4 | 495 | -5 |