> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaantonio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reporting

> Understand the stable query layer for reports, SQL, exports, and Power BI.

`reporting` turns the active CargoWise mirror generation into a smaller business contract.

Use this layer for normal reports, reusable SQL, exports, and Power BI.

## Contract

| Part               | Purpose                                                                        |
| ------------------ | ------------------------------------------------------------------------------ |
| Report roots       | One current row per shipment or one-off quote                                  |
| Detail views       | Repeated charges, dates, parties, milestones, packing lines, and other details |
| Relationship views | Source-backed shipment, consol, quote, and booking links                       |
| `source_fields`    | Optional scalar XML evidence read from `source_data`                           |

Each business view defines its row grain and join keys. See [Schema](/analytics/schema) for the
complete list.

## Why it stays smaller

Reporting exposes the business data needed for normal analysis. It leaves storage, replay state,
generation control, and deeper CargoWise structures in the underlying layers.

This gives reports stable names and documented joins while the internal projection model can grow.

## Compared with the mirror

| Area          | `reporting`                         | `cargowise_mirror`                       |
| ------------- | ----------------------------------- | ---------------------------------------- |
| Main use      | Reports, Power BI, and reusable SQL | Complex, full CargoWise consultation     |
| Data shape    | Supported business views            | Fuller internal current-state model      |
| Generations   | Active generation is automatic      | Query must select the active generation  |
| Stability     | Supported contract                  | Internal model can grow or change        |
| Relationships | Small documented join set           | Broader ownership and relationship model |

## When to use another layer

Use `source_data` for low-level XML evidence, lineage, and field discovery. Use
`cargowise_mirror` when a consultation needs a current CargoWise structure that reporting does not
expose.

Next, read [Data model](/analytics/data-model) to understand roots, details, and relationships.
