FreightMath Logo

FreightMath Data Schema

The FreightMath Data Schema defines the fields, relationships, and minimum business rules required for order-level and segment-level data exchanged between trucking company transportation management systems (TMS) and FreightMath. It ensures a consistent, auditable structure for all FreightMath analytics, pricing tools, and dashboards.

Tier 1 — Conceptual Plain-language overview of Orders, Segments, and key business rules required to support FreightMath.
Tier 2 — Technical Field-by-field specification for data engineers, matching the Excel schema provided by KSMTA (Order and Segment field lists, required flags, data types, and descriptions).

Download Schema & Sample Data

Download the current FreightMath Data Schema workbook, which includes both the Order and Segment schemas plus sample data for each.

Tier 1 — Conceptual Overview

1. Entities & Relationships

The FreightMath schema is organized around two core entities:

ORDER #1001
Total Rev: $1,200
SEG 1
Empty Move
(Driver A)
SEG 2
Linehaul
(Driver A)
SEG 3
Delivery
(Driver B)
Figure 1: The Parent-Child Relationship. A single commercial Order (the revenue event) is linked to multiple operational Segments (physical movements). Note that different drivers or assets can handle different segments of the same Order.

Conceptually:

2. Data Categories

Fields are grouped into logical Data Categories to make mapping and validation simpler:

3. Required vs. Optional Fields

Each schema field in the Excel workbook is tagged with a REQ flag:

For implementation planning, prioritize mapping all Y fields first, then expand into optional fields as data quality, availability, and use cases mature.

4. Joining Orders and Segments

The schema assumes a stable, unique Order key with one-to-many related Segment records:

5. Time & Location Rules (Chronology & Geography)

To ensure consistent chronology, Segments carry “From” and “To” timestamps and locations. The following business rules apply at a high level:

SEGMENT A
08:00 - 10:00
SEGMENT B
10:30 - 14:00
SEGMENT C
14:15 - 18:00
Figure 2: Valid Chronology. Segments must flow sequentially in time. The 'To' timestamp of Segment A should align with or precede the 'From' timestamp of Segment B. Overlaps create costing errors.

6. Financial & Distance Fields

Financial fields captured in the schema are used to compute FreightMath’s Operating Ratio (OR), margin, and profitability metrics. At a minimum:

ORDER REVENUE
-
SUM OF SEGMENT COSTS
=
GROSS MARGIN / OR
Figure 3: Calculating Profitability. FreightMath aggregates costs from all Segments (fuel, driver pay, maintenance) and subtracts them from the Order's total revenue to determine the Operating Ratio.

For many clients, initial implementations map a subset of financial fields and evolve over time toward full coverage, especially as MapLedger and GL-based costing are introduced.

Tier 2 — Technical Appendix (Field-by-Field Specification)

This appendix mirrors the FreightMath Order and Segment field schema workbooks. It is intended for data engineers and technical implementers who are building or maintaining the TMS → FreightMath integration.

Order Field Specification (Order-Level Schema)

The table below lists all Order-level fields as provided in the ORDER FIELD SCHEMA worksheet, including required flags, FreightMath names, explanations, data types, and data categories.

REQ Extract Field Name FreightMath Field Name Explanation Type Data Category
YORDER_IDOrder IDUnique ID for the Customer OrderTextOrder
YCUSTOMER_IDCustomer IDCustomer that tendered the orderTextOrder
YCUSTOMER_NAMECustomer NameTextOrder
YBILLTO_IDBill To IDWho will be billed for the OrderTextOrder
YBILLTO_NAMEBill To NameTextOrder
OBILLTO_TYPEBill To TypeBroker, Shipper, UnidentifiedTextOrder
YPICKUP_TYPEFirst Pickup TypeLive or PreloadedTextOrder
YORIG_ARRIVE_DTTMFirst Pickup Arrival Date and TimeDateTimeChronology
YORIG_DEPART_DTTMFirst Pickup Departure Date and TimeDateTimeChronology
YORIG_LOC_IDFirst Pickup Location IDTextLocation
YORIG_LOC_NAMEFirst Pickup Location NameTextLocation
YORIG_CITYFirst Pickup CityTextGeography
YORIG_STATE_PROVINCEFirst Pickup StateTextGeography
YORIG_POSTAL_CDFirst Pickup Postal CodeTextGeography
YORIG_COUNTRYFirst Pickup CountryTextGeography
OORIG_LATITUDEFirst Pickup LatitudeDecimalGeography
OORIG_LONGITUDEFirst Pickup LongitudeDecimalGeography
YDELIVERY_TYPELast Delivery TypeLive or DropTextOrder
YDEST_ARRIVE_DTTMLast Delivery Arrival Date and TimeDateTimeChronology
YDEST_DEPART_DTTMLast Delivery Departure Date and TimeDateTimeChronology
YDEST_LOC_IDLast Delivery Location IDTextLocation
YDEST_LOC_NAMELast Delivery Location NameTextLocation
YDEST_CITYLast Delivery CityTextGeography
YDEST_STATE_PROVINCELast Delivery StateTextGeography
YDEST_POSTAL_CDLast Delivery Postal CodeTextGeography
YDEST_COUNTRYLast Delivery CountryTextGeography
ODEST_LATITUDELast Delivery LatitudeDecimalGeography
ODEST_LONGITUDELast Delivery LongitudeDecimalGeography
YBILLABLE_MILESOrder MilesBillable Miles in your TMSDecimalDistance
YREVENUE_CHARGE_DETAILRevenue Charge DetailsCode~Qty~Amount|Code~Qty~AmountTextFinancial
YORDER_TOT_REVENUEOrder Total RevenueDecimalFinancial
YORDER_DIVISION_CDOrder Division CodeTextOrder
OTOTAL_WEIGHTTotal WeightTextOrder
YBILLABLE_STOP_CTBillable Stop CountUsed to identify multi-stop OrdersTextOrder
OCOMMODITY_CDCommodity CodeTextOrder
OOPERATION_TYPEOperation TypeAsset or LogisticsTextOrder
OTEMP_MINTemp MinIntOrder
OTEMP_MAXTemp MaxIntOrder
OSALES_IDSales IDTextOrder
OBILLED_DTBilled DateDateTimeOrder
OCUSTOM_TEXT1Custom Text 1TextOrder
OCUSTOM_TEXT2Custom Text 2TextOrder
OCUSTOM_TEXT3Custom Text 3TextOrder
OCUSTOM_TEXT4Custom Text 4TextOrder
OCUSTOM_TEXT5Custom Text 5TextOrder
OCUSTOM_TEXT6Custom Text 6TextOrder
OCUSTOM_TEXT7Custom Text 7TextOrder
OCUSTOM_TEXT8Custom Text 8TextOrder
OCUSTOM_TEXT9Custom Text 9TextOrder
OCUSTOM_TEXT10Custom Text 10TextOrder
Source: FreightMath Order Schema workbook (ORDER FIELD SCHEMA sheet).
Segment Field Specification (Segment-Level Schema)

The table below lists all Segment-level fields as provided in the SEGMENT FIELD SCHEMA worksheet, including required flags, FreightMath names, explanations, data types, and data categories.

REQ Extract Field Name FreightMath Field Name Explanation Type Data Category
YSEGMENT_IDSegment IDUnique ID for each SegmentIntSegment
YFROM_EVENTFrom EventWhat happened at the From LocationTextSegment
YFROM_EVENT_TYPEFrom Event TypePickup, Delivery, or OtherTextSegment
OFROM_EARLIEST_ARRIVE_DTTMFrom Earliest Appointment Date and TimeDateTimeChronology
YFROM_ARRIVE_DTTMFrom Arrival Date and TimeDateTimeChronology
YFROM_DEPART_DTTMFrom Departure Date and TimeDateTimeChronology
OFROM_LATEST_DEPART_DTTMFrom Latest Appointment Date and TimeDateTimeChronology
YFOM_LOC_IDFrom Location IDTextLocation
YFROM_LOC_NAMEFrom Location NameTextLocation
YFROM_CITYFrom CityTextGeography
YFROM_STATE_PROVINCEFrom StateTextGeography
YFROM_POSTAL_CDFrom Postal CodeTextGeography
OFROM_COUNTRYFrom CountryTextGeography
OFROM_LATITUDEFrom LatitudeDecimalGeography
OFROM_LONGITUDEFrom LongitudeDecimalGeography
YTO_EVENTTo EventWhat happened at the To LocationTextSegment
YTO_EVENT_TYPETo Event TypePickup, Delivery, or OtherTextSegment
OTO_EARLIEST_ARRIVE_DTTMTo Earliest Appointment Date and TimeDateTimeChronology
YTO_ARRIVE_DTTMTo Arrival Date and TimeDateTimeChronology
YTO_DEPART_DTTMTo Departure Date and TimeDateTimeChronology
OTO_LATEST_DEPART_DTTMTo Latest Appointment Date and TimeDateTimeChronology
YFOM_LOC_IDTo Location IDTextLocation
YTO_LOC_NAMETo Location NameTextLocation
YTO_CITYTo CityTextGeography
YTO_STATE_PROVINCETo StateTextGeography
YTO_POSTAL_CDTo Postal CodeTextGeography
OTO_COUNTRYTo CountryTextGeography
OTO_LATITUDETo LatitudeDecimalGeography
OTO_LONGITUDETo LongitudeDecimalGeography
YSEGMENT_TMS_MILESSegment TMS MilesDecimalDistance
YMILEAGE_TYPEMileage TypeEmpty or LoadedTextSegment
YSEGMENT_CAPACITY_TYPESegment Capacity TypeSingle or TeamTextAssets
YPOWER_IDPower IDID for the Power Unit (Tractor)TextAssets
YPOWER_DIVISION_CDPower Division CodeTextAssets
YTRAILER1_IDTrailer1 IDTextAssets
YTRAILER1_TYPETrailer1 TypeTextAssets
OTRAILER2_IDTrailer2 IDTextAssets
OTRAILER2_TYPETrailer2 TypeTextAssets
OTRAILER3_IDTrailer3 IDTextAssets
OTRAILER3_TYPETrailer3 TypeTextAssets
YDRIVER1_IDDriver IDTextAssets
YDRIVER1_TYPEDriver TypeCompany, OwnerOperator,Lease, etc.TextAssets
YDRIVER1_DIVISION_CDDriver Division CodeTextAssets
ODRIVER2_IDDriver2 IDTextAssets
ODRIVER2_TYPEDriver2 TypeCompany, OwnerOperator,Lease, etc.TextAssets
ODRIVER2_DIVISION_CDDriver2 Division CodeTextAssets
OTOT_DRIVER_COMPTotal Driver CompensationDecimalFinancial
YCARRIER_IDCarrier IDTextAssets
YCARRIER_NAMECarrier NameTextAssets
YCARRIER_TOT_PAYTotal Carrier CostDecimalFinancial
YASSIGNED_ORDER_IDAssigned Order IDWhich Order ID is this Segment associated withTextSegment
OTOT_WEIGHTTotal WeightTextSegment
ODISPATCHER_IDDispatcher IDTextSegment
OPLANNER_IDPlanner IDTextSegment
OCUSTOM_TEXT1Custom Text 1TextSegment
OCUSTOM_TEXT2Custom Text 2TextSegment
OCUSTOM_TEXT3Custom Text 3TextSegment
OCUSTOM_TEXT4Custom Text 4TextSegment
OCUSTOM_TEXT5Custom Text 5TextSegment
OCUSTOM_TEXT6Custom Text 6TextSegment
OCUSTOM_TEXT7Custom Text 7TextSegment
OCUSTOM_TEXT8Custom Text 8TextSegment
OCUSTOM_TEXT9Custom Text 9TextSegment
OCUSTOM_TEXT10Custom Text 10TextSegment
Source: FreightMath Segment Schema workbook (SEGMENT FIELD SCHEMA sheet).

TMS-Specific Mapping Guides

The core FreightMath Data Schema is TMS-agnostic. However, most clients prefer prescriptive, system-specific guidance. The following sections are reserved for detailed mapping patterns, code snippets, and export templates for major TMS platforms. These will be maintained as separate Knowledge Base pages, with links surfaced here.

McLeod

McLeod Guide: View McLeod Instructions

Status: Final content will include:

  • Recommended McLeod report(s) or data extracts for Orders and Segments.
  • Field-by-field mapping from McLeod names to FreightMath schema.
  • Example SQL/SSRS or API extract logic.
  • Sample transformation script (e.g., Python or SQL) that outputs the CSV formats above.
TMW

Status: Final content will include:

  • Recommended TMW tables/views for Orders and Movements.
  • Join keys and logic to derive Segments from TMW events.
  • Example stored procedures or exports to the FreightMath CSV layout.
Innovative / AS400

Innovative Guide: View Innovative Instructions

Status: Final content will include:

  • Standard Innovative/AS400 files and screens used to source Orders and Segments.
  • Logic for translating trip/leg structures into FreightMath segments.
  • Example ETL pattern for nightly CSV or database pushes.
Alvys

Status: Final content will include:

  • API endpoints and webhooks recommended for Order/Segment data.
  • JSON-to-CSV transformation patterns into the FreightMath schema.
  • Authentication and paging considerations for production feeds.
Truckmate

Status: Final content will include:

  • Key Truckmate tables, extracts, or APIs used to derive Orders and Segments.
  • Mapping of Truckmate trip/leg constructs to FreightMath segments.
  • Example scripts or SSIS packages that output FreightMath-ready CSVs.

Note: Separate Knowledge Base pages will provide TMS-specific mapping examples (e.g., McLeod, TMW, MercuryGate, etc.), including code snippets and ETL patterns that map native TMS fields into this FreightMath Data Schema.