Skip to main content
Analytics is a graph of business-owned relational data. The model answers three questions for every query:
  1. What does one row represent?
  2. Which business object owns the row?
  3. Which evidence connects it to other objects?

Core terms

An identity can exist without a current full entity. This happens when CargoWise supplies an explicit reference to an object whose full body has not arrived.

The graph

reporting.entity_identities resolves every evidence-backed endpoint. A row with is_reference_only = true has no current full object body. reporting.business_entities contains current full recognized objects. It stores shared route, cargo, direction, JobCosting summary, and lineage fields. Subtype relations add the business number or subtype-specific fields:
  • business_shipments
  • business_one_off_quotes
  • business_consols
  • business_bookings

Ownership through entity_id

Every current typed detail row belongs to a business entity through entity_id.
This key is the normal join path for business reporting. A displayed job number, quote number, organization code, name, or route is not a replacement for entity_id. An organization code can appear in several party roles. A date code can occur several times. A charge code can repeat. The owning entity and the row’s documented grain preserve the meaning.

Nested ownership through component_id

Repeated objects receive a component_id. Nested components also retain parent_component_id. Consider one shipment containing a container and a penalty:
The rows keep these keys:
The typed entity_container_penalties view also exposes container_component_id, which joins directly to entity_containers.component_id. Analytics does not create a component for every XML tag. Repeated meaningful objects become components. Scalar values become properties. Structural wrappers remain visible in source paths.

Properties and the long tail

reporting.entity_properties stores current scalar values that do not need a dedicated typed column. Each property retains:
  • the owning entity_id
  • an optional owning component_id
  • the CargoWise field name and relative path
  • the original value
  • safe typed and normalized values when available
  • source lineage
Properties let you use an uncommon field without waiting for a new report-specific table. They are still limited to recognized entity roots. Values outside those roots remain in the source observation layer.

Entity relationships

reporting.entity_relationships stores one observed directed edge. The important columns are: Both endpoints join to entity_identities. The observing entity joins to business_entities.

Quote conversion

CargoWise can place QuoteNumber on a shipment, booking, or consol. Analytics creates a directed edge only from that explicit evidence:
The observer is the shipment, booking, or consol whose XML contained QuoteNumber. Analytics never creates this link because a quote number resembles a job number or because route, customer, date, weight, or amount happens to match.

Parent and inherited context

Other entity relationship types include: The same logical edge can be observed in several versions. Use EXISTS for eligibility or deduplicate the endpoint pair when you need one business relationship.

Component relationships

Nesting and referencing are different. parent_component_id records structural nesting. entity_component_relationships records an explicit reference between components that can live in different parts of the XML tree. Supported component relationships include:
  • packing_line_to_container
  • instruction_container_link_to_container
  • instruction_packing_line_link_to_packing_line
For a packing line reference:
resolution_status tells you whether the endpoint resolved. The source reference and diagnostic remain queryable when it did not.

Missing relationships

reporting.relationship_projection_audits explains why an expected entity link is present or absent. A missing link does not remove either entity or its values.

Current and historical relations

Current detail can come from an earlier valid entity version after a partial update. Join current business queries by entity_id. Do not require the detail version to equal the entity’s current version.

Grain protects totals

A grain is what one row represents:
  • one row in business_entities means one current full entity
  • one row in entity_charges means one charge line
  • one row in entity_packing_lines means one packing line
  • one row in entity_relationships means one observed edge
Suppose one entity has two matching dates, three matching charges, and two matching staff assignments. A direct join produces 12 rows for the same entity. Use EXISTS when detail only decides whether an entity qualifies:
Use a pre-aggregated subquery when you need a detail measure beside an entity measure:
Confirm currency before summing charge amounts. Confirm normalized units before summing weight. Continue to Power BI for a reusable semantic model or Query with SQL for query workflows.