Create mart dbt models for dashboard tabs #62

Closed
opened 2026-01-16 16:20:24 +00:00 by lmiranda · 1 comment
Owner

Summary

Create dbt mart layer models that serve as the final analytical tables for each dashboard tab.

Models to Create

Model Tab Key Metrics
mart_neighbourhood_overview Overview Composite livability score
mart_neighbourhood_housing Housing Affordability index, rent-to-income ratio
mart_neighbourhood_safety Safety Crime rates per 100K, YoY change
mart_neighbourhood_demographics Demographics Income, age distribution, diversity
mart_neighbourhood_amenities Amenities Parks, schools, transit per capita

Acceptance Criteria

  • All 5 mart models created in dbt/models/marts/
  • Each mart optimized for its dashboard tab
  • Composite livability score calculation documented
  • Models include geometry for choropleth mapping
  • Models documented in _marts.yml
  • dbt run --select marts passes
  • dbt test passes for all models

Technical Notes

  • Marts should be wide tables with all metrics needed by their tab
  • Include neighbourhood_id, neighbourhood_name, and geometry in all marts
  • Livability score is a weighted composite of safety, affordability, and amenity scores

Labels: type:feature, component:database, priority:high, tech:dbt

## Summary Create dbt mart layer models that serve as the final analytical tables for each dashboard tab. ## Models to Create | Model | Tab | Key Metrics | |-------|-----|-------------| | `mart_neighbourhood_overview` | Overview | Composite livability score | | `mart_neighbourhood_housing` | Housing | Affordability index, rent-to-income ratio | | `mart_neighbourhood_safety` | Safety | Crime rates per 100K, YoY change | | `mart_neighbourhood_demographics` | Demographics | Income, age distribution, diversity | | `mart_neighbourhood_amenities` | Amenities | Parks, schools, transit per capita | ## Acceptance Criteria - [ ] All 5 mart models created in `dbt/models/marts/` - [ ] Each mart optimized for its dashboard tab - [ ] Composite livability score calculation documented - [ ] Models include geometry for choropleth mapping - [ ] Models documented in `_marts.yml` - [ ] `dbt run --select marts` passes - [ ] `dbt test` passes for all models ## Technical Notes - Marts should be wide tables with all metrics needed by their tab - Include `neighbourhood_id`, `neighbourhood_name`, and `geometry` in all marts - Livability score is a weighted composite of safety, affordability, and amenity scores **Labels:** type:feature, component:database, priority:high, tech:dbt
lmiranda added this to the Launch: Host, Bio and Toronto House Market Analysis project 2026-01-16 16:36:47 +00:00
lmiranda self-assigned this 2026-01-16 16:36:50 +00:00
lmiranda moved this to Done in Launch: Host, Bio and Toronto House Market Analysis on 2026-01-16 16:37:48 +00:00
Author
Owner

Completed

All 5 mart models created:

  • mart_neighbourhood_overview.sql - Composite livability score (safety 30%, affordability 40%, amenities 30%)
  • mart_neighbourhood_housing.sql - Affordability index, rent-to-income ratio
  • mart_neighbourhood_safety.sql - Crime rates per 100K, crime index, safety tier
  • mart_neighbourhood_demographics.sql - Income/age indices, tenure diversity
  • mart_neighbourhood_amenities.sql - Amenity index, per-capita metrics

Acceptance Criteria Met:

  • All 5 mart models created in dbt/models/marts/
  • Each mart optimized for its dashboard tab
  • Composite livability score calculation documented
  • Models include geometry for choropleth mapping
  • Models documented in _marts.yml
  • dbt parse passes without errors
## Completed ✅ All 5 mart models created: - `mart_neighbourhood_overview.sql` - Composite livability score (safety 30%, affordability 40%, amenities 30%) - `mart_neighbourhood_housing.sql` - Affordability index, rent-to-income ratio - `mart_neighbourhood_safety.sql` - Crime rates per 100K, crime index, safety tier - `mart_neighbourhood_demographics.sql` - Income/age indices, tenure diversity - `mart_neighbourhood_amenities.sql` - Amenity index, per-capita metrics **Acceptance Criteria Met:** - [x] All 5 mart models created in `dbt/models/marts/` - [x] Each mart optimized for its dashboard tab - [x] Composite livability score calculation documented - [x] Models include geometry for choropleth mapping - [x] Models documented in `_marts.yml` - [x] `dbt parse` passes without errors
Sign in to join this conversation.