# KHAP — Kenya Health Analytics Pipeline
> **A production-grade analytics engineering pipeline transforming Kenya county-level health and socioeconomic data into a Power BI dashboard — built with Python, dbt, DuckDB, and Apache Airflow.**
---
## The problem
Kenya's health system is governed at the county level — 47 County Health Management Teams (CHMTs) each tracking maternal health, immunisation, disease burden, and workforce indicators against national targets set in the Kenya Health Sector Strategic Plan. The data exists across two systems — KNBS (socioeconomic) and KHIS/DHIS2 (health service delivery) — but rarely gets joined, modelled, or visualised together in a way that supports county-level decision-making.
KHAP builds the missing layer: a reproducible pipeline that ingests both sources, models them into an analytical warehouse, and powers a Power BI dashboard that any CHMT or national MoH analyst can use to track progress, identify underperforming counties, and target interventions.
---
## What this project does
KHAP ingests 29 indicators across population, poverty, education, infrastructure, maternal health, immunisation, disease burden, and health workforce for all 47 Kenya counties from 2015–2024. A dbt transformation layer cleans, pivots, and models this into three analytical mart tables using window functions for rankings, rolling averages, and year-on-year change. An Airflow DAG orchestrates the full pipeline daily with data quality gates that halt on error. The final tables export to Power BI, where a 3-page dashboard tracks national progress against strategic targets, maps disease burden by county, and provides drill-through county health profiles.
---
## Key findings from the pipeline
| Metric | 2015 | 2024 | Change |
|---|---|---|---|
| National ANC4 coverage | 65.3% | 77.0% | +11.7 pp |
| National DPT3 coverage | — | 94.3% | **Target met** (≥90%) |
| Health System Index equity gap | — | 0.406 | Nairobi (0.96) vs Turkana (0.56) …