Skip to contents

Counts Network Manager area flights per day and market segment, filtering the flights fact to operational statuses (TE, TA, AA) and the requested date window. Segments are resolved through SWH_FCT.DIM_FLIGHT_TYPE_RULE, and missing day/segment combinations are backfilled with zeros to give a complete calendar grid.

Usage

pbwg_market_segment_tfc_counts(wef, til, conn = NULL)

Arguments

wef

Start date (inclusive). Can be anything that lubridate::as_date() understands.

til

End date (inclusive). Can be anything that lubridate::as_date() understands.

conn

Optional Oracle DBI::DBIConnection. When omitted a fresh connection to PRUDEV is created via eurocontrol::db_connection(), with access to SWH_FCT.V_FAC_FLIGHT_MS and PRUDEV.V_PRU_AIRCRAFT_CATEGORY.

Value

A tibble::tibble() with one row per day/market segment and an attached "sql" attribute. Columns:

  • YEAR: numeric year extracted from ENTRY_DATE.

  • MONTH: numeric month extracted from ENTRY_DATE.

  • ENTRY_DATE: truncated IFPZ entry date (UTC).

  • MARKET_SEGMENT: market segment label from DIM_FLIGHT_TYPE_RULE.

  • MARKET_SEGMENT_DESCR: description from DIM_FLIGHT_TYPE_RULE.

  • UNIT_CODE: fixed "NM_AREA".

  • UNIT_NAME: fixed "Total Network Manager Area".

  • FLIGHT: count of flights for the date/segment combination.