Skip to content

Commit 77a4a1c

Browse files
gnguyen87gnguyen87rlittle08
authored
Feature/other names (#148)
* draft stg_other_name model * minor updates to model * rename cols * remove unnecessary cols * debug * Update CHANGELOG.md --------- Co-authored-by: gnguyen87 <gnguyen@macalester.edu> Co-authored-by: rlittle08 <rlittle@edanalytics.org>
1 parent e1e89a9 commit 77a4a1c

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Unreleased
22

33
## New features
4+
- Add `stg_ef3__students__other_names`
45
## Under the hood
56
## Fixes
67

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
with students as (
2+
select * from {{ ref('stg_ef3__students') }}
3+
),
4+
flattened as (
5+
select
6+
tenant_code,
7+
api_year,
8+
k_student,
9+
k_student_xyear,
10+
{{ extract_descriptor('value:otherNameTypeDescriptor::varchar') }} as other_name_type,
11+
value:personalTitlePrefix::varchar as personal_title_prefix,
12+
value:firstName::varchar as first_name,
13+
value:middleName::varchar as middle_name,
14+
value:lastSurname::varchar as last_surname,
15+
value:generationCodeSuffix::varchar as generation_code_suffix
16+
from students
17+
{{ json_flatten('v_other_names') }}
18+
)
19+
20+
select * from flattened

0 commit comments

Comments
 (0)