Skip to main content

api_v1.kommune_befolkning_alder

Atlas view

api_v1.kommune_befolkning_alder

api_v1.kommune_befolkning_alder

Population by kommune, year and age band — the denominator layer for rates.

Built from​

This Atlas view joins data from the following upstream sources. Click through for provenance, methodology, and citation.

Showing direct dbt parents. See full lineage in /lineage/ →

Columns​

ColumnDescription
kommune_nr4-digit kommune code. FK to dim_kommune.
kommune_nameKommune name in bokmål, joined from dim_kommune.
fylke_nr2-digit fylke code, derived from kommune_nr in dim_kommune.
fylke_nameJoined from dim_fylke. NULL for kommune codes whose fylke has no row there — Svalbard-style 21xx codes. A LEFT join on purpose: an inner one would drop those kommuner from the denominator entirely, which is worse than a missing label.
yearCalendar year. SSB 07459 covers 1986 onwards.
alder_0_5Residents aged 0-5 (pre-school). Disjoint band.
alder_6_15Residents aged 6-15 (grunnskole age). Disjoint band.
alder_16_17Residents aged 16-17. Disjoint band, and the one that completes 0_17.
alder_18_66Residents aged 18-66 (working age, to the 67 pension threshold). Disjoint band.
alder_67_79Residents aged 67-79. Disjoint band.
alder_80_plusResidents aged 80 and over, including SSB's open-ended '105+' bucket. Disjoint band. Built from age_min, not age_int — age_int is NULL for '105+', so banding on it would silently drop those residents.
alder_0_17Residents aged 0-17. ⚠️ A ROLL-UP of 0_5 + 6_15 + 16_17, NOT a seventh band — adding it to the disjoint bands double-counts. The child-poverty denominator, so that coverage_gap_barnefattigdom's share can be read against a population rather than against itself.
alder_67_plusResidents aged 67 and over. ⚠️ A ROLL-UP of 67_79 + 80_plus, NOT a band. This is the elderly denominator the consumer in #1281 did not have; 67 is Norway's pension age and the choice of threshold is the reader's, which is why the two bands are published beside it.
befolkning_totalAll residents of the kommune in that year. Equals the six disjoint bands summed. 🔴 Sexes are FILTERED, not summed: SSB's Kjonn dimension codes '0' as ALL, so summing every sex row would double the population of every kommune in Norway. The model selects male and female explicitly, and the singular test bands_sum_to_the_population_total is what would catch it if that ever stopped being true.

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/kommune_befolkning_alder?limit=5

About this view​

Population by kommune, year and age band — the denominator layer for rates. Population by kommune, year and age band — the denominator layer. Published as api_v1.kommune_befolkning_alder. Built from SSB table 07459 (age and sex distribution), which Atlas has ingested and refreshed nightly for months while serving it to nobody: nothing downstream of raw read it, so `GET /ssb-07459` returned 404. A consumer built its elderly-care view around care USERS rather than elderly RESIDENTS and wrote a README section apologising for it, noting the substitution flatters a kommune with a high threshold for granting services (urb-agents #1281). ⚠️ SIX BANDS SUM TO befolkning_total. TWO DO NOT — they are roll-ups of the six, provided because PostgREST has aggregates disabled and a consumer would otherwise add them client-side: sum to the total: 0_5 · 6_15 · 16_17 · 18_66 · 67_79 · 80_plus roll-ups: 0_17 = 0_5 + 6_15 + 16_17 67_plus = 67_79 + 80_plus Bands rather than a single "elderly" threshold on purpose. 67 is defensible and it is still an editorial claim; publishing the bands leaves that claim with whoever makes it, and the same rows serve as the denominator for child poverty and working-age dependency. ⚠️ Counts are residents, not care recipients, and they are SSB's register population at the start of the year — not an average over it. Historical kommune codes are excluded: only kommuner active today get rows, so a 1990 row exists for today's kommune, not for the one that held that code in 1990.