name: op-overlay-delta-vs-ref
kind: operator
category: OVERLAY
operator: OVERLAY_DELTA_VS_REF
description: Compose-host additive delta of target slot value against the matching reference slot value (matrix or series).
type: reference
applies_to: compose
examples_tags: [overlay, compose, before-after]
Compose-only dual-shape. Overlays decorate the host; no Response.Components.
Use when
Each cell or group of a target Compose request minus the same coordinate in the reference request, in the target’s own units.
Questions it answers:
- How many points did each segment’s score move since last wave?
- How much more or less did each region sell this year than last?
Use something else:
OVERLAY_INDEX_VS_REFwhen you want a ratio rather than a gap.OVERLAY_T_CELLwhen you want a test of whether the means differ.
Params
| Name | Type | Default | Description |
|---|---|---|---|
field | string | — | OUTPUT LABEL of the aggregation to score on every slot (label, else TYPE_field) or an expanded element column <label>[<elem>] (params.expand); absent = each slot’s aggregations[0]; rows key on group columns only; a slot lacking it → PULSE_OVERLAY_FIELD_UNKNOWN. |
scope (enum, required) — cell (matrix host) or group (SERIES host). reference (string, required) — reference slot label. targets (list, required) — target slot labels (one or more). Other ref arms → PULSE_OVERLAY_REF_INCOMPATIBLE_WITH_SHAPE.
Host shape
COMPOSE dual-shape: MATRIX crosstab OR SERIES host on reference + target. Slots must match on schema, keys and dictionaries. Subtractive twin of the reference index.
Output
MATRIX (cell host) or SERIES (group host) — per-coordinate target − reference, in the target slot’s units. Layer summary.baseline = 0. One layer per target, in targets order: one target keeps name; two or more are <name>__<target>, each the one-target layer. Over options.max_panel_targets (16) → PULSE_OVERLAY_PANEL_TARGETS_OVER_CAP.
Contract
- Weight: not read; a weight in force is skipped.
- Streaming: streamable.
Gotchas
- An undefined value (NaN — a mean over a group with no value, an unanswered element) on either side is MISSING, as on the request host: series — the entry keeps its key with NO
statistic(absent, notnull); matrix — the cell stays absent; no warning, out ofsummary.count. - No division — a zero reference never raises
PULSE_OVERLAY_REF_ZERO. - Target key absent from the reference →
PULSE_OVERLAY_REF_ZEROwithref_missing=true; no entry is emitted for it (series: the entry is DROPPED; matrix: the cell stays absent) — never a NaN entry. - The SERIES form is streamable (manifest
buffered: false); the MATRIX form buffers. - A code cell (
AGG_MODEovercategorical_*/packed_bool) on either slot →PROCESSING_CONFIG, reasoncategorical_code; use a count cell.