Add cumulative enrollment and 6-year graduation metrics#3356
Add cumulative enrollment and 6-year graduation metrics#3356anthonygwalters wants to merge 11 commits intomainfrom
Conversation
…gs to persistence model Adds four new columns to int_kippadb__persistence (exposed in rpt_tableau__kfwd_persistence): - cumulative_semesters_enrolled: running count of semesters a student was enrolled as of each semester (inclusive). Collapses multiple concurrent enrollments per semester via max(is_persisting_int) before summing. - is_6yr_graduate_any / _ba / _aa: static boolean per student indicating whether they graduated (any path, BA only, or AA only) within the 6-year scaffold window. Uses logical_or() over the full student partition so the value is consistent across all semester rows. https://claude.ai/code/session_016VscmMbi8kie1s8VDwsUt7
…laude/review-kfwd-persistence-model-dYUQA
…gs to persistence model Adds four new columns to int_kippadb__persistence (exposed in rpt_tableau__kfwd_persistence): - cumulative_semesters_enrolled: running count of semesters a student was enrolled as of each semester (inclusive). Collapses multiple concurrent enrollments per semester via max(is_persisting_int) before summing. - is_6yr_graduate_any / _ba / _aa: static boolean per student indicating whether they graduated (any path, BA only, or AA only) within the 6-year scaffold window. Uses logical_or() over the full student partition so the value is consistent across all semester rows. https://claude.ai/code/session_016VscmMbi8kie1s8VDwsUt7
Add cumulative_semesters_enrolled, is_6yr_graduate_any, is_6yr_graduate_ba, and is_6yr_graduate_aa to the schema files for int_kippadb__persistence and rpt_tableau__kfwd_persistence. https://claude.ai/code/session_016VscmMbi8kie1s8VDwsUt7
d182953 to
47fa9f4
Compare
…github.com/TEAMSchools/teamster into claude/review-kfwd-persistence-model-dYUQA
|
@anthonygwalters I'm adding some uniqueness testing, should every student only have one row per year and semester? this pulls in all enrollments during that window so some students have multiple |
that's unavoidable unfortunately, hence the rn |
|
rn_enrollment_year? should we filter that in the main select statement? we could also dedupe |
…github.com/TEAMSchools/teamster into claude/review-kfwd-persistence-model-dYUQA
…laude/review-kfwd-persistence-model-dYUQA
70764be to
efbf873
Compare
|
@claude review this PR |
|
Claude finished @cbini's task in 1m 38s —— View job PR Review
Overall the new CTEs are cleanly structured. One critical issue must be resolved before merging, plus a few smaller observations. Critical: Uniqueness test will fail — unresolved multi-enrollmentThe - dbt_utils.unique_combination_of_columns:
combination_of_columns:
- student_number
- persistence_year
- semesterBut the final This is exactly what the open comment thread is about.
Medium:
|
| Block on merge | Missing rn_enrollment_year = 1 filter — uniqueness test will fail |
| Recommend fixing | Implicit semester asc sort ordering |
| Opportunistic | Add contract + uniqueness test to rpt_tableau__kfwd_persistence.yml |
Pull Request
Summary & Motivation
When merged, this pull request will add new metrics to the persistence model to track cumulative semesters enrolled and 6-year graduation outcomes by degree type. These metrics enable better analysis of student persistence patterns and graduation rates in the KFWD persistence reporting.
Changes
enrollment_by_semesterCTE to aggregate enrollment status by semestercumulative_enrollmentCTE to calculate cumulative semesters enrolled using a window functionis_6yr_graduate_any: Whether student graduated (any degree type)is_6yr_graduate_ba: Whether student graduated with a Bachelor's degreeis_6yr_graduate_aa: Whether student graduated with an Associate's degreecumulative_semesters_enrolledfield to the persistence modelSelf-review
General
dbt
[model name].ymlproperties file for all modelsSQL
distinctusage must be accompanied by a comment explaining its necessityorder byforselectstatementsTest Plan
Existing dbt tests should pass. Verify that:
https://claude.ai/code/session_016VscmMbi8kie1s8VDwsUt7