-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3345 from cal-itp/ntd_additions
Adds ntd data - annual database service
- Loading branch information
Showing
7 changed files
with
378 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
warehouse/models/mart/ntd/dim_annual_ntd_agency_service.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{{ config(materialized="table") }} | ||
with source as ( | ||
select * from {{ ref("stg_ntd__annual_database_service") }} | ||
), | ||
|
||
dim_annual_ntd_agency_service AS ( | ||
SELECT | ||
_dt, | ||
year, | ||
state_parent_ntd_id, | ||
ntd_id, | ||
agency_name, | ||
reporter_type, | ||
subrecipient_type, | ||
reporting_module, | ||
mode, | ||
tos, | ||
time_period, | ||
time_service_begins, | ||
time_service_ends, | ||
vehicles_passenger_cars_operated_in_maximum_service, | ||
vehicles_passenger_cars_available_for_maximum_service, | ||
trains_in_operation, | ||
vehicles_passenger_cars_in_operation, | ||
actual_vehicles_passenger_car_miles, | ||
actual_vehicles_passenger_car_revenue_miles, | ||
actual_vehicle_passenger_deadhead_miles, | ||
scheduled_actual_vehicle_passenger_car_revenue_miles, | ||
actual_vehicle_passenger_car_hours, | ||
actual_vehicle_passenger_car_revenue_hours, | ||
actual_vehicle_passenger_car_deadhead_hours, | ||
charter_service_hours, | ||
school_bus_hours, | ||
train_miles, | ||
train_revenue_miles, | ||
train_deadhead_miles, | ||
train_hours, | ||
train_revenue_hours, | ||
train_deadhead_hours, | ||
unlinked_passenger_trips__upt_, | ||
ada_upt, | ||
sponsored_service_upt, | ||
passenger_miles, | ||
days_of_service_operated, | ||
days_not_operated_due_to_strikes, | ||
strike_comment, | ||
days_not_operated_due_to_emergencies, | ||
emergency_comment, | ||
non_statutory_mixed_traffic, | ||
drm_mixed_traffic_row, | ||
FROM source | ||
) | ||
SELECT * FROM dim_annual_ntd_agency_service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.