Skip to content

Commit

Permalink
feat(dim_annual_ntd_agency_service): adds new category service_type t…
Browse files Browse the repository at this point in the history
…o make analysis easier on the different modes
  • Loading branch information
V authored and vevetron committed Jun 26, 2024
1 parent 4888563 commit eb0c102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions warehouse/models/mart/ntd/_mart_ntd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,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 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

0 comments on commit eb0c102

Please sign in to comment.