Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/TEAMSchools/teamster into s…
Browse files Browse the repository at this point in the history
…tar-dl-fix
Anthony Walters committed Jan 29, 2025
2 parents 0ef0109 + 1f631c6 commit d7d2c8b
Showing 3 changed files with 83 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -100,6 +100,7 @@ select
is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -211,6 +212,7 @@ select
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -322,6 +324,7 @@ select
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -433,6 +436,7 @@ select
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -544,6 +548,7 @@ select
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -655,6 +660,7 @@ select
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
@@ -764,7 +770,9 @@ select
null as is_exempt,
null as is_late,
null as is_missing,

cte_grouping,
code_type,

coalesce(audit_flag_name, 'no_flag') as audit_flag_name,
coalesce(audit_flag_value, 0) as audit_flag_value,
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ with

eoq_items as (
select -- All but Conduct Code
r.*, f.cte_grouping, f.audit_category,
r.*, f.cte_grouping, f.audit_category, f.code_type,

from
{{ ref("int_tableau__gradebook_audit_section_week_student_scaffold") }}
@@ -135,7 +135,7 @@ with

eoq_items_conduct_code as (
select -- Conduct Code for ES (requires grade level join)
r.*, f.cte_grouping, f.audit_category,
r.*, f.cte_grouping, f.audit_category, f.code_type,

from
{{ ref("int_tableau__gradebook_audit_section_week_student_scaffold") }}
@@ -267,6 +267,7 @@ select
t.avg_expected_scored_percent,

f.audit_category,
f.code_type,

if(r.audit_flag_value, 1, 0) as audit_flag_value,
from student_unpivot as r
@@ -397,6 +398,7 @@ select
null as teacher_avg_score_for_assign_per_class_section_and_assign_id,

f.audit_category,
f.code_type,

if(r.audit_flag_value, 1, 0) as audit_flag_value,
from student_unpivot as r
@@ -530,6 +532,7 @@ select
null as teacher_avg_score_for_assign_per_class_section_and_assign_id,

r.audit_category,
r.code_type,

if(s.audit_flag_value, 1, 0) as audit_flag_value,
from eoq_items as r
@@ -656,6 +659,7 @@ select
null as teacher_avg_score_for_assign_per_class_section_and_assign_id,

r.audit_category,
r.code_type,

if(s.audit_flag_value, 1, 0) as audit_flag_value,
from eoq_items_conduct_code as r
@@ -793,6 +797,7 @@ select
as teacher_avg_score_for_assign_per_class_section_and_assign_id,

f.audit_category,
f.code_type,

if(r.audit_flag_value, 1, 0) as audit_flag_value,
from teacher_unpivot as r
@@ -928,6 +933,7 @@ select
null as teacher_avg_score_for_assign_per_class_section_and_assign_id,

f.audit_category,
f.code_type,

if(r.audit_flag_value, 1, 0) as audit_flag_value,
from teacher_unpivot as r
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ with

audit_category,
cte_grouping,
code_type,
audit_flag_name,
max(audit_flag_value) as audit_flag_value,

@@ -125,6 +126,7 @@ with

audit_category,
cte_grouping,
code_type,
audit_flag_name,
audit_flag_value as flag_value,

@@ -195,3 +197,68 @@ left join
and t.audit_category = v.audit_category
and t.cte_grouping = v.cte_grouping
and t.audit_flag_name = v.audit_flag_name
where t.code_type = 'Gradebook Category'

union all

select
t.*,
v.studentid,
v.student_number,
v.student_name,
v.grade_level,
v.salesforce_id,
v.ktc_cohort,
v.enroll_status,
v.cohort,
v.gender,
v.ethnicity,
v.advisory,
v.year_in_school,
v.year_in_network,
v.rn_undergrad,
v.is_out_of_district,
v.is_retained_year,
v.is_retained_ever,
v.lunch_status,
v.gifted_and_talented,
v.iep_status,
v.lep_status,
v.is_504,
v.is_counseling_services,
v.is_student_athlete,
v.ada,
v.ada_above_or_at_80,
v.date_enrolled,

v.category_quarter_percent_grade,
v.category_quarter_average_all_courses,

v.quarter_course_percent_grade_that_matters,
v.quarter_course_grade_points_that_matters,
v.quarter_citizenship,
v.quarter_comment_value,

v.raw_score,
v.score_entered,
v.assign_final_score_percent,
v.is_exempt,
v.is_late,
v.is_missing,

v.flag_value,

from teacher_aggs as t
left join
valid_flags as v
on t.academic_year = v.academic_year
and t.region = v.region
and t.schoolid = v.schoolid
and t.quarter = v.quarter
and t.audit_qt_week_number = v.audit_qt_week_number
and t.sectionid = v.sectionid
and t.teacher_number = v.teacher_number
and t.audit_category = v.audit_category
and t.cte_grouping = v.cte_grouping
and t.audit_flag_name = v.audit_flag_name
where t.code_type = 'Quarter'

0 comments on commit d7d2c8b

Please sign in to comment.