File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
warehouse/models/mart/transit_database Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -79,10 +79,14 @@ models:
79
79
description : |
80
80
The organization's ID in the National Transit Database / FTA agency ID number.
81
81
Data entry processes / sources of truth for this field have changed over time.
82
- As of May 2023, the source is the `raw_ntd_id` field in the Airtable `organizations` table;
82
+ As of May 2023, the source is the `raw_ntd_id` field in the Airtable `organizations` table
83
+ which is derived from 2021 ntd ids;
83
84
for records before May 2023, sources were some combination of the `NTD agency info` table in
84
85
Airtable and the `ntd_agency_to_organizations` CSV seed file in this dbt project (now
85
86
renamed to `_deprecated__ntd_agency_to_organizations`).
87
+ - name : ntd_id_2022
88
+ description : |
89
+ Just pulls out the 5 digit component of the raw_ntd_id
86
90
- name : name
87
91
description : Organization name
88
92
- name : organization_type
Original file line number Diff line number Diff line change @@ -32,9 +32,11 @@ dim_organizations AS (
32
32
WHEN _valid_from >= ' 2023-05-23' THEN raw_ntd_id
33
33
ELSE ntd_to_org .ntd_id
34
34
END AS ntd_id,
35
+ IF(LENGTH(ntd_id) >= 10 ,
36
+ SUBSTR(ntd_id, - 5 ),
37
+ ntd_id) AS ntd_id_2022,
35
38
public_currently_operating,
36
39
public_currently_operating_fixed_route,
37
-
38
40
_is_current,
39
41
_valid_from,
40
42
_valid_to
You can’t perform that action at this time.
0 commit comments