Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor ridership fixes #3378

Merged
merged 4 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions warehouse/models/mart/ntd/_mart_ntd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -436,6 +438,8 @@ models:
NTD recognizes a number of different modes including Motorbus (MB),
Heavy Rail (HR), Light Rail (LR), and Demand Response (DR), among
others.
- name: service_type
description: A summarization of modes into Fixed Route and Demand Response
- name: _3_mode
description: 3 Mode - A grouping of modes based upon whether the mode operates
on rail, is a bus mode, is ferry boat service or other.
Expand All @@ -446,6 +450,8 @@ models:
- name: legacy_ntd_id
description: Legacy NTD ID – The Transit Property’s NTD identification number in
the Legacy NTD Database
- name: period_year_month
description: ""
- name: period_month
description: ""
- name: period_year
Expand Down
5 changes: 5 additions & 0 deletions warehouse/models/mart/ntd/dim_annual_ntd_agency_service.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ dim_annual_ntd_agency_service AS (
subrecipient_type,
reporting_module,
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,
tos,
time_period,
time_service_begins,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ 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', 'MO', 'AG') 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,
concat(period_year, '-', lpad(period_month, 2, '0')) as period_year_month,
period_year,
period_month,
upt,
Expand Down
Loading