Skip to content

Commit

Permalink
Merge pull request #290 from TEAMSchools/deanslist-extracts
Browse files Browse the repository at this point in the history
std domains
  • Loading branch information
cbini authored Sep 14, 2023
2 parents 8361c13 + d2d081c commit 0f4dd22
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/dbt/kipptaf/models/assessments/sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,16 @@ sources:
data_type: STRING
- name: description
data_type: STRING
- name: src_assessments__standard_domains
external:
options:
format: GOOGLE_SHEETS
uris:
- https://docs.google.com/spreadsheets/d/1G2z9rwXsFaMdFL6iOYdfQTVjZ7bctXMyz_Q09IhP4QE
sheet_range: src_assessments__standard_domains
skip_leading_rows: 1
columns:
- name: standard_code
data_type: STRING
- name: standard_domain
data_type: STRING
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from {{ source("assessments", "src_assessments__standard_domains") }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
with
response_rollup as (
select
sr.powerschool_student_number,
sr.academic_year,
sr.term_administered,
sr.percent_correct,
if(
sr.subject_area = 'Writing', 'Text Study', sr.subject_area
) as subject_area,

st.standard_domain,
from {{ ref("int_assessments__response_rollup") }} as sr
inner join
{{ ref("stg_assessments__standard_domains") }} as st
on sr.response_type_code = st.standard_code
where
sr.response_type = 'standard'
and sr.is_internal_assessment
and sr.academic_year = {{ var("current_academic_year") }}
and sr.subject_area in ('Text Study', 'Mathematics', 'Writing')
and sr.module_type in ('QA', 'MQQ')
and sr.powerschool_student_number in (
select student_number
from {{ ref("stg_powerschool__students") }}
where
grade_level < 5
and not regexp_contains(_dbt_source_relation, r'kippmiami')
)
),

standard_avg as (
select
powerschool_student_number,
academic_year,
term_administered,
subject_area,
standard_domain,
round(avg(percent_correct), 0) as avg_percent_correct,
from response_rollup
group by
powerschool_student_number,
academic_year,
term_administered,
subject_area,
standard_domain
)

select
powerschool_student_number as local_student_id,
academic_year,
term_administered,
subject_area,
standard_domain,
avg_percent_correct,
case
when avg_percent_correct >= 85
then 'Exceeds Expectations'
when avg_percent_correct >= 70
then 'Met Expectations'
when avg_percent_correct >= 50
then 'Approaching Expectations'
when avg_percent_correct >= 30
then 'Below Expectations'
when avg_percent_correct >= 0
then 'Far Below Expectations'
end as performance_level,
from standard_avg

0 comments on commit 0f4dd22

Please sign in to comment.