A dbt project for industry-specific analytical views. The current implementation focuses on Higher Education (HED) student success, retention risk, engagement, program performance, data quality, and semantic-layer access.
This project is structured so additional industries can be added later under their own models/<industry>/ folders while sharing the same dbt project configuration, dependency management, and deployment patterns.
- Source: Source table configured through dbt vars
- Default source:
RAW.INDUSTRIES_HIGHER_EDUCATION.HED_RECORDS - dbt source:
source('hed', 'hed_records') - Target schema config:
industries_higher_education - Primary materialization: views
The HED models provide analytics for:
- Executive student-success KPIs
- Student-level retention risk analysis
- Program/major performance benchmarking
- LMS and academic engagement analytics
- Data quality monitoring
- Semantic-layer exploration over engagement and at-risk-student data
dbt_industries_views/
├── dbt_project.yml
├── packages.yml
├── package-lock.yml
├── profiles.yml # Local profile example; do not commit real credentials
├── HED_SETUP_GUIDE.md # Detailed HED setup and deployment guide
├── macros/
│ └── generate_schema_name.sql
├── seeds/
│ └── hed_records.csv
└── models/
└── hed/
├── _hed__sources.yml
├── staging/
│ ├── _staging__schema.yml
│ └── stg_hed__students.sql
├── intermediate/
│ ├── _intermediate__schema.yml
│ ├── int_hed__engagement_categories.sql
│ └── int_hed__risk_levels.sql
├── data_quality/
│ ├── _data_quality__schema.yml
│ ├── dq_hed__completeness.sql
│ ├── dq_hed__duplicates.sql
│ ├── dq_hed__freshness.sql
│ └── dq_hed__validity.sql
├── marts/
│ ├── schema.yml
│ ├── vw_hed_student_success_kpi.sql
│ ├── vw_hed_retention_risk_analysis.sql
│ ├── vw_hed_program_performance.sql
│ ├── vw_hed_engagement_analytics.sql
│ └── vw_hed_data_quality.sql
└── semantic_models/
├── metricflow_time_spine.sql
├── sem_vw_hed_engagement_analytics.yml
└── sv_hed_at_risk_students.sql
The base student-record staging model. It centralizes the HED source reference, selects and standardizes the source columns, and adds reusable calculations such as:
days_since_last_logindays_active_since_enrollmentcredit_success_rate_pct
Student-level risk classification model. It derives GPA, completion, engagement, login-recency, financial-aid, intervention, and overall retention-risk categories.
Student-level engagement classification model. It derives categories for login recency, course views, assignments, discussion participation, engagement level, and recommended engagement actions.
The data-quality layer breaks quality checks into focused component models:
dq_hed__completenessdq_hed__duplicatesdq_hed__freshnessdq_hed__validity
These feed the mart-level vw_hed_data_quality dashboard view.
Executive-level single-row KPI view summarizing enrollment, retention risk, GPA, course completion, engagement, financial aid, interventions, academic integrity incidents, and data freshness.
Student-level retention-risk view identifying at-risk students, risk drivers, severity levels, and recommended interventions.
Major/program-level aggregation comparing enrollment, academic outcomes, retention risk, engagement, financial aid, interventions, academic integrity incidents, and overall program health.
Student-level engagement analytics across LMS login recency, course views, assignments, discussion participation, engagement categories, and recommended actions.
Single-row data-quality dashboard summarizing completeness, validity, uniqueness, freshness, and overall quality status.
Date spine table used by MetricFlow for time-based semantic-layer queries.
MetricFlow semantic model and metrics for vw_hed_engagement_analytics.
Snowflake semantic view over vw_hed_retention_risk_analysis, exposing facts, dimensions, filters, and verified queries for at-risk-student analysis.
The HED source is defined in models/hed/_hed__sources.yml and configured with dbt vars.
Current project vars in dbt_project.yml:
vars:
hed_source_database: 'RAW'
hed_source_schema: 'INDUSTRIES_HIGHER_EDUCATION'
hed_source_table: 'HED_RECORDS'Source definition pattern:
sources:
- name: hed
database: "{{ var('hed_source_database', 'HOL_DATABASE') }}"
schema: "{{ var('hed_source_schema', 'INDUSTRIES_HIGHER_EDUCATION') }}"
tables:
- name: hed_records
identifier: "{{ var('hed_source_table', 'HED_RECORDS') }}"Note:
dbt_project.ymlcurrently setshed_source_databasetoRAW, while the source YAML fallback isHOL_DATABASE. The explicit project var takes precedence. If this project is reused in a different environment, update the vars indbt_project.ymlor override them at runtime.
- dbt with Snowflake adapter support
- Snowflake account and role with permissions to read the HED source table and create models in the target database/schema
- Access to the configured HED source table
- Installed dbt packages from
packages.yml
Install package dependencies:
dbt depsPackages used by this project:
dbt-labs/dbt_utils1.1.1Snowflake-Labs/dbt_semantic_view1.0.3
Validate the local dbt configuration:
dbt debugInstall dependencies:
dbt depsCompile the project:
dbt compileBuild the HED models and tests:
dbt build --select hed.*Run only HED models:
dbt run --select hed.*Run only HED tests:
dbt test --select hed.*Run by tag:
dbt run --select tag:hed
dbt run --select tag:educationRun a specific mart:
dbt run --select vw_hed_student_success_kpiselect *
from INDUSTRIES_HIGHER_EDUCATION.VW_HED_STUDENT_SUCCESS_KPI;select
student_id,
major_code,
advisor_id,
current_gpa,
engagement_score,
overall_risk_assessment,
recommended_action
from INDUSTRIES_HIGHER_EDUCATION.VW_HED_RETENTION_RISK_ANALYSIS
order by current_gpa asc;select
major_code,
total_students,
avg_gpa,
at_risk_percentage,
program_health_score,
performance_category
from INDUSTRIES_HIGHER_EDUCATION.VW_HED_PROGRAM_PERFORMANCE
order by program_health_score desc;select
student_id,
major_code,
days_since_last_login,
engagement_level,
engagement_concern_level,
recommended_engagement_action
from INDUSTRIES_HIGHER_EDUCATION.VW_HED_ENGAGEMENT_ANALYTICS
order by days_since_last_login desc;select *
from INDUSTRIES_HIGHER_EDUCATION.VW_HED_DATA_QUALITY;Adjust database and schema names as needed for the active dbt target and schema-generation behavior.
Run tests for HED models:
dbt test --select hed.*Test the HED source:
dbt test --select source:hedGenerate docs:
dbt docs generateServe docs locally:
dbt docs serveThis project can be run from dbt Core, dbt Cloud, or another orchestrator.
A typical deployment command for the current HED implementation is:
dbt build --select hed.*For narrower deployments, select by folder, model, or tag:
dbt build --select hed.marts.*
dbt build --select tag:data_quality
dbt build --select vw_hed_retention_risk_analysisThe project includes a dbt-cloud project id in dbt_project.yml, but credentials and environment configuration should be managed outside the repository.
To add another industry, follow the same folder-based pattern used by HED.
Example for agriculture:
models:
dbt_industries_views:
agr:
+tags: ['agr', 'agriculture']
+schema: industries_agriculture
+materialized: view
vars:
agr_source_database: 'RAW'
agr_source_schema: 'INDUSTRIES_AGRICULTURE'
agr_source_table: 'AGR_RECORDS'Create models/agr/_agr__sources.yml:
version: 2
sources:
- name: agr
database: "{{ var('agr_source_database') }}"
schema: "{{ var('agr_source_schema') }}"
tables:
- name: agr_records
identifier: "{{ var('agr_source_table') }}"Recommended structure:
models/agr/
├── _agr__sources.yml
├── staging/
├── intermediate/
├── data_quality/
├── marts/
└── semantic_models/ # Optional
Add schema YAML files for model descriptions, column descriptions, and data tests. Follow the HED directory as the current convention.
dbt build --select agr.*Check the HED source vars:
hed_source_database
hed_source_schema
hed_source_tableThen confirm the active dbt target has permission to read the resolved Snowflake object.
Run:
dbt compile --select hed.*Review the failing model and any referenced YAML files for Jinja, YAML, or dependency errors.
Run a narrower test selection to isolate the issue:
dbt test --select stg_hed__students
dbt test --select vw_hed_data_qualityDo not loosen or remove tests without first confirming whether the failure is caused by source data quality, model logic, or an outdated test assumption.
Check that the source table has rows and that the model's filters are not excluding expected records. Start with the staging model and work downstream through intermediate and mart models.
Check package installation and Snowflake support for the configured semantic view materialization. Re-run:
dbt deps
dbt compile --select hed.semantic_models.*For detailed setup and deployment instructions specific to the Higher Education analytics package, see HED_SETUP_GUIDE.md.
- Project name:
dbt_industries_views - Version:
1.0.0 - Warehouse adapter: Snowflake
- Current industry: Higher Education (HED)
- Current source:
hed.hed_records - Primary target schema config:
industries_higher_education - Primary materialization: views