diff --git a/warehouse/models/mart/ntd/_mart_ntd.yml b/warehouse/models/mart/ntd/_mart_ntd.yml index 7723c12b72..8a7b35a02e 100644 --- a/warehouse/models/mart/ntd/_mart_ntd.yml +++ b/warehouse/models/mart/ntd/_mart_ntd.yml @@ -68,6 +68,8 @@ models: description: The mode of service operated under the contract. A contractor can operate more than one mode/TOS under a contract (only one B-30 for that contractor). + - name: service_type + description: A summarization of modes into Fixed Route and Demand Response - name: tos description: The type of service operated under the contract. - name: time_period diff --git a/warehouse/models/mart/ntd/dim_monthly_ntd_ridership_with_adjustments.sql b/warehouse/models/mart/ntd/dim_monthly_ntd_ridership_with_adjustments.sql index 37a58d49c0..eab3342983 100644 --- a/warehouse/models/mart/ntd/dim_monthly_ntd_ridership_with_adjustments.sql +++ b/warehouse/models/mart/ntd/dim_monthly_ntd_ridership_with_adjustments.sql @@ -14,6 +14,11 @@ select agency, mode_type_of_service_status, mode, + CASE + WHEN mode IN ('AR', 'CC', 'CR', 'HR', 'YR', 'IP', 'LR', 'MG', 'SR', 'TR', 'MB', 'RB', 'CB', 'TB', 'FB', 'IP') THEN 'Fixed Route' + WHEN mode IN ('DR', 'DT', 'VP', 'JT', 'PB') THEN 'Demand Response' + ELSE 'Unknown' -- mode is null sometimes + END AS service_type, _3_mode, tos, legacy_ntd_id,