Sensor A keeps values 10,15,12 with predecessors NULL,10,15 and total 37 on every row. Filtering before lag changes the population.

Window functions give a row its neighbourhood

Window functions let a report retain individual readings while adding information from related rows. A sensor reading can show its predecessor, its change, and its share of the sensor’s total without reducing the sensor to one output row. Correctness depends on defining the population, the partition, and the ordering before interpreting those extra columns. ...

October 18, 2026 · 5 min · XB Field Notes