Skip to content

Commit

Permalink
create Star, update state testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Walters committed Oct 3, 2024
1 parent c720a65 commit 2ee6206
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/dbt/kipptaf/models/extracts/deanslist/rpt_deanslist__star.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
select
student_display_id as student_number,
academic_year,
screening_period_window_name as test_round,
state_benchmark_category_level,
state_benchmark_category_name,
state_benchmark_proficient,
unified_score,

concat(state_benchmark_category_name, ' (', unified_score, ')') as score_display,
from {{ ref("int_renlearn__star_rollup") }}
where rn_subj_round = 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ select
co.student_number,

p.assessmentyear as academic_year,
p.academic_year as academic_year_int,
'Spring' as test_round,
p.assessment_name as test_type,
p.discipline as `subject`,
p.subject as test_name,
Expand All @@ -17,3 +19,32 @@ from {{ ref("stg_powerschool__students") }} as co
inner join
{{ ref("int_pearson__all_assessments") }} as p
on co.state_studentnumber = p.statestudentidentifier

union all

select
co.student_number,

concat(
cast(fl.academic_year as string), '-', cast(fl.academic_year + 1 as string)
) as academic_year,
fl.academic_year as academic_year_int,
fl.administration_window as test_round,
'FAST' as test_type,
fl.discipline as `subject`,
fl.assessment_subject as test_name,
fl.scale_score,
fl.achievement_level as proficiency_level,

if(fl.is_proficient, 1, 0) as is_proficient,

row_number() over (
partition by co.student_number, fl.assessment_subject
order by fl.academic_year asc, fl.administration_window asc
) as test_index,
from {{ ref("stg_powerschool__students") }} as co
inner join
{{ ref("stg_powerschool__u_studentsuserfields") }} as suf
on co.dcid = suf.studentsdcid
and {{ union_dataset_join_clause(left_alias="co", right_alias="suf") }}
inner join {{ ref("stg_fldoe__fast") }} as fl on suf.fleid = fl.student_id
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
select
student_display_id,
state_benchmark_category_level,
state_benchmark_category_name,
state_benchmark_proficient,
unified_score,
screening_period_window_name,

safe_cast(left(school_year, 4) as int) as academic_year,
safe_cast(if(grade = 'K', '0', grade) as int) as grade_level,
case
when _dagster_partition_subject = 'SM'
then 'Math'
when _dagster_partition_subject = 'SR'
then 'Reading'
when _dagster_partition_subject = 'SEL'
then 'Early Literacy'
end as star_subject,
case
when _dagster_partition_subject = 'SM'
then 'Math'
when grade = 'K' and _dagster_partition_subject = 'SEL'
then 'ELA'
when _dagster_partition_subject = 'SR'
then 'ELA'
end as star_discipline,
row_number() over (
partition by
student_display_id,
_dagster_partition_subject,
school_year,
screening_period_window_name
order by completed_date desc
) as rn_subj_round,
row_number() over (
partition by
student_display_id,
_dagster_partition_subject,
school_year,
screening_period_window_name
order by completed_date desc
) as rn_subj_year,
from {{ ref("stg_renlearn__star") }}
where deactivation_reason is null

0 comments on commit 2ee6206

Please sign in to comment.