From 0dab91a2fbd169c6b20f685bd0e674e6811f1e0f Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 4 Nov 2026 02:38:40 +0000 Subject: [PATCH] address review: store running-total entries only for items with a number --- crates/engine/src/pivot/compute.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/pivot/compute.rs b/crates/engine/src/pivot/compute.rs index f2d417b40..b784a8e4c 100644 --- a/crates/engine/src/pivot/compute.rs +++ b/crates/engine/src/pivot/compute.rs @@ -368,7 +368,9 @@ fn running_total(raw: Value, lookup: &ValueLookup<'_>, context: &ShowContext<'_> let mut path = Vec::with_capacity(rest.len() + 1); path.push(*item); path.extend_from_slice(rest); - total += number(&lookup.get(&path, context.col_path, context.value_index)).unwrap_or(0.0); + // An item with no number here adds nothing and is not stored (the shown cell always has one). + let Some(value) = number(&lookup.get(&path, context.col_path, context.value_index)) else { continue }; + total += value; by_item.entry(*item).or_insert(total); } (by_item, total)