/reporting-and-dashboards:reporting-architecture-modelling-and-aggregation-trapsfrom reporting-and-dashboards
Diagnoses why dashboard numbers are wrong by covering analytics architecture, dimensional modelling (facts, dimensions, grain), aggregation traps (fan-out, chasm, additivity, distinct-count non-decomposition), and metric definition pitfalls that cause disagreement between dashboards. Part of a 5-part reporting reference.
Ships in reporting-and-dashboards. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 1 of 5 of the Reporting and Dashboards reference (plugin
reporting-and-dashboards), covering §0–§4. Sibling skills:reporting-semantic-layer-time-and-performance(§5–§8),reporting-dashboard-design-charts-and-alerting(§9–§11),reporting-access-control-embedded-and-testing(§12–§14),reporting-reference(§15–§20). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Dimensional modelling and the aggregation traps are permanent. Two areas moved. See §16 →
reporting-referencefor the semantic layer market and text-to-SQL.
Scope. Written for engineers who have been handed "we need a dashboard" and discovered it is a harder problem than it looked. ⚠️ §2 and §3 are where the silent wrong numbers come from, and they are the reason this document exists.
⚠️ GOTCHA boxes mark things that produce confidently wrong numbers rather than errors.
The three ideas that matter most:
- ⚠️ The failure mode is a plausible wrong number, not an exception. A join that double-counts, an average of averages, a timezone boundary — all of these return successfully and look reasonable. Analytics has almost no natural error signal (§2, §3).
- ⚠️ A metric definition is an interface, and undefined interfaces diverge. If "active user" lives in six dashboards it has six definitions, and they will disagree in a meeting. This is the entire argument for a semantic layer (§5 →
reporting-semantic-layer-time-and-performance, §16.1 →reporting-reference).- ⚠️ Most dashboards are never looked at, and that is a design failure, not a user failure. A dashboard nobody opens cost real money and produces nothing. Build for a decision, not for coverage (§9 →
reporting-dashboard-design-charts-and-alerting).
| You want... | Go to |
|---|---|
| The architecture | §1 |
| Dimensional modelling | §2 |
| The aggregation traps | §3 |
| Metric definition pitfalls | §4 |
| The semantic layer | §5 → reporting-semantic-layer-time-and-performance |
| Time handling | §6 → reporting-semantic-layer-time-and-performance |
| Query performance | §7 → reporting-semantic-layer-time-and-performance |
| Caching and freshness | §8 → reporting-semantic-layer-time-and-performance |
| Dashboard design | §9 → reporting-dashboard-design-charts-and-alerting |
| Chart selection | §10 → reporting-dashboard-design-charts-and-alerting |
| Alerting | §11 → reporting-dashboard-design-charts-and-alerting |
| Access control | §12 → reporting-access-control-embedded-and-testing |
| Embedded analytics | §13 → reporting-access-control-embedded-and-testing |
| Testing analytics | §14 → reporting-access-control-embedded-and-testing |
| Misconceptions | §15 → reporting-reference |
| What moved | §16 → reporting-reference |
| Numbers | §17 → reporting-reference |
| Books | §18 → reporting-reference |
| Quick reference | §19 → reporting-reference |
Sources → INGESTION → raw/landing → TRANSFORMATION → modelled tables
→ [SEMANTIC LAYER] → BI tool / API / embedded → humans and agents
↘ alerting, exports, reverse ETL
⚠️ ELT beat ETL because storage got cheap and warehouses got fast: load raw, transform in-warehouse, keep the raw layer so you can re-derive when definitions change. ⚠️ The ability to reprocess history after fixing a definition is worth more than the storage it costs.
Layering (medallion, or staging/intermediate/marts — the names vary and the shape doesn't):
Raw/bronze ⚠️ immutable, source-shaped, never modified
Staging/silver cleaned, typed, deduplicated, renamed to conventions
Marts/gold ⚠️ business-shaped: facts and dimensions, or wide tables
⚠️ Resist transforming in the BI tool. Logic in a dashboard is invisible, untested,
unversioned and unreusable — and it's how you get six definitions of the same metric
(§5 → reporting-semantic-layer-time-and-performance).
⚠️ Kimball's star schema is 1996 and still correct, because it solves a problem that hasn't changed: making a warehouse queryable by people who didn't build it.
FACT table ⚠️ measurements at a defined GRAIN, plus foreign keys
DIMENSION tables descriptive attributes you filter and group by
⚠️ GOTCHA — declaring the grain is the single most important modelling decision, and skipping it causes most fact-table bugs. ⚠️ "One row per order line per shipment" is a grain; "orders" is not. Every measure in the table must be true at that grain. If you find yourself unsure whether to sum a column, the grain was never properly declared.
Fact types, and the distinction drives everything downstream:
Transaction one row per event. ⚠️ Fully additive
Periodic snapshot state at intervals (daily balance). ⚠️ NOT additive over time
Accumulating snapshot one row per process instance, updated as it progresses
Factless ⚠️ events with no measure — attendance, eligibility. Count the rows
Dimensions: conformed (⚠️ shared across facts — this is what makes cross-process analysis possible, and it's the hard organizational part), degenerate (an order number living on the fact), junk (⚠️ flags bundled together rather than exploding your dimension count), role-playing (⚠️ one date dimension viewed as order date, ship date, return date).
⚠️ Slowly changing dimensions — get this wrong and history silently rewrites itself:
Type 1 overwrite ⚠️ history LOST. Last year's report changes when someone
moves territory. Often not what anyone wanted
Type 2 new row + validity dates + current flag ⚠️ the standard for real history
Type 3 previous-value column limited
Type 4/6 hybrids
⚠️ The symptom of an unintended Type 1 is a historical report that no longer reproduces — and by the time someone notices, the old values are gone.
One Big Table (OBT) — ⚠️ denormalize everything into a wide table. Columnar storage makes this cheap and it's genuinely simpler for consumers. ⚠️ The costs are real though: update anomalies, storage, and the fan-out problem (§3) baked in permanently rather than at query time. Use it for a well-understood consumption surface, not as the modelling layer.
⚠️ This section is the highest-value part of the document. These bugs return successful queries with wrong numbers, and they are extremely common.
⚠️ GOTCHA — joining a fact to a one-to-many relationship multiplies your measures.
orders (1 row, amount = $100) JOIN order_items (3 rows) → SUM(orders.amount) = $300 ⚠️ WRONG, and it looks fine⚠️ The join duplicated the order row three times, and the sum duplicated with it. This is the single most common cause of inflated revenue figures in BI, and it is especially insidious because the number is plausible — just too big.
The fixes: aggregate before joining (⚠️ the cleanest), use
SUM(DISTINCT ...)carefully, use window functions, ⚠️ or let a semantic layer handle it — Looker'ssymmetric aggregatesand MetricFlow's join logic exist specifically for this (§5 →reporting-semantic-layer-time-and-performance).
⚠️ Two fact tables joined through a shared dimension produce a Cartesian product.
customers ← orders (3 orders)
customers ← support_tickets (4 tickets)
JOIN both through customers → ⚠️ 12 rows. Both sums are wrong
⚠️ The fix is never a join: aggregate each fact separately and combine the results —
a FULL OUTER JOIN on the aggregates, or a union-and-pivot pattern.
FULLY ADDITIVE revenue, units — ⚠️ sum across every dimension including time
SEMI-ADDITIVE ⚠️ balances, inventory, headcount — additive across everything
EXCEPT time. Summing December's daily balances is nonsense;
you want the last value, or an average
NON-ADDITIVE ⚠️ ratios, percentages, averages, distinct counts.
NEVER sum, and never average
⚠️ GOTCHA — the most common non-additive error is averaging a ratio. Conversion rate for three regions: 10%, 20%, 30%. The company rate is NOT 20%. ⚠️ You must recompute from the components:
SUM(conversions)/SUM(visits). The average-of-averages answer is wrong whenever the denominators differ, which is essentially always.
COUNT(DISTINCT user) per region does not sum to COUNT(DISTINCT user) overall —
⚠️ a user active in two regions is counted twice. This breaks pre-aggregation,
breaks roll-ups, and breaks any cached daily table you were hoping to sum into a monthly
figure.
⚠️ The mitigations: recompute at each grain (expensive but correct), or use
HyperLogLog sketches, which ⚠️ are mergeable and approximate — and the approximation
is usually fine for a dashboard and not fine for billing.
⚠️ Simpson's paradox — a trend present in every subgroup can reverse in the aggregate. ⚠️ This is not a curiosity; it happens in real business data whenever group sizes shift. A treatment can improve outcomes for every segment while appearing to worsen results overall, because the mix changed. The defence is to always be able to decompose a metric by its main dimensions, and to be suspicious when an aggregate moves against all its parts.
⚠️ Other definitional traps:
What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/reporting-access-control-embedded-and-testingUse when analytics has to be secure, embedded in a product, or trustworthy over time: access control including row-level and column-level security and the multi-tenant cases, embedded analytics and its architectural and licensing considerations, and testing analytics — the assertions worth writing, reconciliation, and catching a metric regression before a stakeholder does./reporting-dashboard-design-charts-and-alertingUse when designing what people actually look at: dashboard design including audience, hierarchy, defaults and the failure modes of the everything-dashboard, chart selection matched to the question being asked, and alerting including threshold design, noise, and why most alerting gets ignored.Other plugins' skills for the same job
/reporting-referenceUse when correcting an analytics misconception, checking what moved in the semantic layer market or in natural-language querying where the benchmarks and the demos disagree (verified August 2026), looking up a threshold or performance figure, finding the canon, or needing a picker and a pre-ship checklist. Companion to the other reporting-and-dashboards skills.npx claudepluginhub the-vibey-project/vibey --plugin reporting-and-dashboards