api_v1.unattributed_totals
Atlas view
api_v1.unattributed_totals
api_v1.unattributed_totalsThe part of a published quantity that belongs to no municipality.
Built from
This Atlas view joins data from the following upstream sources. Click through for provenance, methodology, and citation.
Atlas internal model ↗
dim_brreg_enhet
Current state of every organisation registered in Norway — the whole of Brønnøysundregistrene's Enhetsregisteret, ~1.17M rows, reconciled from the bulk snapshot (PLAN-001) plus…
Atlas internal model ↗
dim_kommune
Canonical kommune dimension.
Atlas internal model ↗
fact_kommune_indicators
First cross-source mart.
Showing direct dbt parents. See full lineage in /lineage/ →
Columns
| Column | Description |
|---|---|
| relation | The published relation this remainder belongs to, e.g. `kommune_ngo_totals`. Not a foreign key: it names a relation, not a row. |
| measure | The column of that relation the value would have contributed to. |
| reason | Why the value is unattributable. `no_kommune_nr` — upstream publishes the record with no municipality at all. For Brreg this is 10.3 % of active voluntary units and is what Brreg itself publishes; it is not an Atlas defect. `kommune_nr_not_current` — the record HAS a kommune_nr and it is not one of the current municipalities. 🔴 Today these are all Svalbard (2100): a real code, absent from SSB's Klass 131, so `kommune_ngo_totals` emits no row for it. Without this reason the relation named 7 489 of 7 532 and the obvious reconciliation came out 43 short with no error anywhere (urb-agents #1318). Historical kommune codes would land here too if Brreg ever used one. `sentinel_9999` — upstream attributes the value to its own 'Uoppgitt' bucket. ⚠️ Note this is the same 9999 that `classify_region_code` calls `unspecified_national` and that `dim_kommune.is_active` still returns as a municipality. |
| source_id | The upstream source the quantity comes from. |
| year | Calendar year, where the quantity is time-varying. NULL for register snapshots like Brreg, which have no year dimension — a null here means "not applicable", never "unknown". |
| unattributed_value | The part that belongs to no municipality. Add this to a sum over the per-kommune relation to reconcile with the upstream national figure. |
| total_value | The whole quantity, attributed and unattributed together. The denominator for the share. |
| unattributed_share_pct | `unattributed_value` as a percentage of `total_value`, to one decimal. NULL when total_value is zero, because a share of nothing is undefined rather than zero. |
Sample query
Live PostgREST query that returns the first 5 rows. URL adapts to the current host — local dev shows api-atlas.localhost; the deployed site shows the configured API base.
https://api-atlas.urbalurba.com/unattributed_totals?limit=5
About this view
The part of a published quantity that belongs to no municipality.
The part of a published quantity that belongs to no municipality.
Published as api_v1.unattributed_totals.
🔴 Atlas had no convention for this, and the two surfaces that met
it chose opposite wrong answers: SSB's 9999 'Uoppgitt' sits INSIDE
a per-kommune relation and corrupts any sum over it, while 7 488
active voluntary units with no kommune_nr fall OUT of one and
vanish silently. One smuggles the remainder in as a row, the other
discards it, and a consumer summing either gets a number that is
wrong in a direction it cannot see (urb-agents #700, #1250, #1265).
✅ The rule this establishes: the VALUE belongs, the ROW does not.
A per-kommune relation carries only kommuner; the remainder lives
here, named, so reconciling to a national total is a deliberate
act rather than an accident of whether a sentinel survived a
filter.
⚠️ It does NOT remove the 9999 rows from dim_kommune or
coverage_gap_barnefattigdom. That is a breaking contract change —
`?is_active=eq.true` would return 357 instead of 358 with no
warning — and it is deliberately not bundled with an additive
change. `is_sentinel` remains a stopgap and this view does not
make the trap gone.
🔵 A zero is a result. Where the remainder is genuinely nothing
this emits 0 rather than omitting the row: "we checked, none" and
"nobody checked" are different answers, and a missing row cannot
tell them apart.
✅ THE ARITHMETIC CLOSES, AND A TEST SAYS SO. Summing a per-kommune
relation and adding every `unattributed_value` for it must equal
`total_value`:
kommune_ngo_totals 65 270
no_kommune_nr 7 489
kommune_nr_not_current 43
---------------------------
total_value 72 802
⚠️ It did not close on the day this shipped. It named 7 489 of
7 532 and the 43 Svalbard organisations were counted by neither
relation — silent, self-consistent, and visible only by doing the
subtraction this view exists to support. The singular test
`the_remainder_closes_the_total` now asserts the decomposition
rather than the parts, which is the thing that was missing: every
part had a test and the relationship between them had none.