Kommune dimension
Atlas view
Kommune dimension
api_v1.dim_kommuneThe canonical municipality registry from SSB Klass 131, with fylke name joined.
Built from
This Atlas view joins data from the following upstream sources. Click through for provenance, methodology, and citation.
Atlas internal model ↗
dim_fylke
Canonical fylke dimension, sourced from SSB Klass classification 104.
Atlas internal model ↗
dim_kommune
Canonical kommune dimension.
Showing direct dbt parents. See full lineage in /lineage/ →
Columns
| Column | Description |
|---|---|
| kommune_nr | 4-digit zero-padded kommune code, SSB canonical form ('0301' = Oslo). The join key every other Atlas relation uses. |
| kommune_name | Kommune name in bokmål. |
| kommune_name_alt | The alternative official name where SSB publishes one — in practice the Sámi variant, split out of upstream's "Name - Nama" string rather than left embedded in kommune_name. NULL for most kommuner. |
| fylke_nr | 2-digit fylke code, derived from the first two digits of kommune_nr per SSB's long-standing convention. |
| fylke_name | Joined from dim_fylke. NULL where the fylke code is not in dim_fylke — pseudo-regions and Svalbard (21xx) — rather than dropping the kommune, so an unresolvable fylke costs a label and not a row. |
| is_active | True when the CODE is current — which is not the same as "this is a municipality". 358 rows satisfy it: 357 kommuner plus the 9999 sentinel. Combine with is_sentinel. ⚠️ Sentinel codes such as 9999 'Uoppgitt' are present in this dimension and reach api_v1 views unmarked — whether they should be excluded or flagged is an open product question (urb-agents #700), raised again by a consumer whose first build reported 358 kommuner and carried a null-everything row into a chart. |
| valid_from | Date the code became valid. NULL where upstream gives none. |
| valid_to | Date the code became inactive. NULL = still active. |
| notes | Upstream's own note on the code, typically recording a merger or reorganisation. NULL for most rows. |
| is_sentinel | True for SSB's 9999 'Uoppgitt' bucket — a current code that is not a municipality. ⚠️ is_active does NOT exclude it. `?is_active=eq.true` returns 358, not 357, and the extra row is this one (measured on the live API, urb-agents #1265). For real municipalities filter `?is_sentinel=is.false`. 🔵 THIS RELATION KEEPS THE ROW ON PURPOSE, AND IT IS NOW THE ONLY PUBLISHED ONE THAT DOES. SSB's Klass 131 contains 9999, and this dimension mirrors SSB's kommune list — dropping it would mean Atlas's list no longer matches the source anyone would reconcile against. ⚠️ As of 2026-09-21 the ANALYTICAL relations no longer carry it: coverage_gap_barnefattigdom, indicator_latest_values, indicator_missing_kommuner and kommune_ngo_summary exclude it, and indicator_summary stopped counting it in its coverage figures. Those are Atlas's own constructs and their grain is "one municipality"; this one is a mirror. Terje's decision, urb-agents #1301. The unattributable value it represented is published in `unattributed_totals`, not discarded. |
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/dim_kommune?limit=5
About this view
The canonical municipality registry from SSB Klass 131, with fylke name joined.
The canonical municipality registry — SSB Klass 131, with fylke
name joined. Published as api_v1.dim_kommune.
Fourteen references in this file already pointed at dim_kommune —
five column descriptions saying "FK to dim_kommune" and the rest
`relationships` tests — while it was not published. A consumer
building on the API found the gap and called publishing it "the
single highest-leverage small addition on this list — every
consumer is currently rebuilding it, and each of us is rebuilding
it slightly differently" (urb-agents #1250, finding 4).
Historical codes are included with is_active = false, because a
consumer joining older data needs them to resolve. Filter
?is_active=is.true for today's 357.
Population and centroids are deliberately absent — see the model
for why; both would be wrong in a dimension rather than merely
missing.