From 6affb4517a3b7a0213a83db12e1c3bd8761021af Mon Sep 17 00:00:00 2001 From: delchev Date: Mon, 7 Sep 2026 10:07:51 +0300 Subject: [PATCH] docs(spec): a count tile over an aggregating report sums its count measure A report declaring measures yields one row per group, so counting its rows shows the number of groups - four statuses in place of fourteen requests. Say what the count is, that an aggregating report must declare `count(*)`, and that one without it is rejected rather than tiled with the group count. Co-Authored-By: Claude Opus 5 --- docs/spec/presentation.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/spec/presentation.md b/docs/spec/presentation.md index b386a10..8954f69 100644 --- a/docs/spec/presentation.md +++ b/docs/spec/presentation.md @@ -119,9 +119,15 @@ reports: dimensions: [Product] measures: ["sum(quantity)", "sum(total)"] widget: { kind: list, limit: 5, label: Sales by Product } + + - name: RequestsByStatus + source: VacationRequest + dimensions: [Status] + measures: ["count(*)", "sum(days)"] # count(*) is what the count tile sums + widget: { kind: count, label: Vacation Requests } ``` -- `kind: count` (default) — the number of records the report yields. +- `kind: count` (default) — the number of records the report yields. An **aggregating** report (one declaring `measures`) yields one row per group, so its record count is its `count(*)` measure summed over those rows — a report dimensioned by status shows the fourteen requests, not the four statuses they fall into. Such a report must declare that measure; an aggregating report with a count tile and no `count(*)` is rejected at generation, because the only number left to show is the number of groups. A report that does not aggregate needs nothing: one of its rows is one record. - `kind: value` — one aggregate cell: `value` names a measure; `at` pins dimension columns. The `now` token resolves at view time, type-aware (current `YYYYMM` on a `month(x)` dimension, current year on `year(x)`, today on a date column). - `kind: list` — the report's first `limit` rows (default 5) as a compact table tile.