Skip to main content

Solution Example collection 01

Reporting Foundations

These projects show two controls that come before a report. The first builds one reliable set of sales, purchasing and stock tables from Microsoft's Wide World Importers sample. The second checks whether a purchase order, warehouse receipt and supplier invoice agree before payment or reporting.

Both SQL builds run from retained files. Their published counts, dates and checks are recalculated by the verification commands.

Native SQL evidenceThe reporting mart exposes row counts, reconciled totals and the release decision alongside the SQL build.

Two engineering decisions

Two reporting problems need two different controls.

The wholesale model aligns customers, products, dates and totals before anyone compares margin. The payment check brings the order, receipt and invoice together before an Accounts Payable analyst decides what happens next.

Reporting mart and reconciliation architectureThe upper sequence turns sales, purchase and stock records into tested reporting tables for the monthly review. The lower sequence compares purchase orders and goods receipts with supplier invoices, applies matching rules and assigns each unresolved difference to the person who can investigate it.WHOLESALE REPORTING MODELBusiness recordsSales + purchasesStock movementsPrepare + rejectType and key checksInvalid rows retainedShared dimensionsCustomer + productSupplier + dateReporting factsSales + purchasingStock + marginMonthly reviewOne agreed set of totalsSUPPLIER INVOICE MATCH CONTROLPO + receiptsOrdered and receivedSupplier invoicesBilled line + taxMatch rulesQuantity + price + taxTolerance + precedenceInvoice decisionApprove / hold / queryBalanced controlTeam responseReason + next stepPurchasing / receiving
The upper model gives wholesale reports shared customers, products and dates. The lower comparison decides whether a supplier invoice can proceed to payment.
01

Operational table contracts

Included files, fields, owners and expected controls are declared before transformation.

02

Declared grain

The row meaning is declared for every transaction, fact, snapshot and exception table.

03

Staging and marts

File preparation remains separate from the reporting tables used by the business.

04

Matching rules

Document joins, reason precedence and tolerances are visible in executable SQL.

05

Tests

Counts, values, keys, dates and exception treatments are checked on each run.

06

Lineage

A result can be followed back through the model to the records that produced it.

07

Reproducible execution

Retained records, code, database and verification scripts rebuild the published results.

The two builds

Different questions require different models.

The first project builds reusable reporting tables. The second makes a payment decision for one supplier invoice. Their records, checks and reviewers are deliberately different.

Flagship reporting build

SQL-backed Reporting Foundation

A wholesale distributor needs sales, purchasing, stock and margin reports to use the same customers, products, dates and totals. The build prepares Microsoft’s Wide World Importers sample for that reporting routine.

Decision
Can the May 2016 sales and stock report be released, and which sales, purchase or stock records need correction first?
One record to trace
InvoiceLineID 1 is followed from Sales.InvoiceLines through staging, shared keys, the sales fact, validation and the monthly revenue measure.
Current maturity
Native build validated with 18 passing controls and a repeatable clean rebuild.
Inspect SQL-backed Reporting Foundation
Executed DuckDB evidence showing Wide World Importers fact-table counts, May 2016 sales and margin, and 18 passing release checks

Purchase-to-pay decision

Purchase Order, Receipt and Invoice Reconciliation

An Accounts Payable analyst holds an invoice until the purchase order, warehouse receipt and supplier bill agree within tolerance. Every unresolved difference keeps its reason and the team responsible for the next step.

Decision
Can the supplier invoice be released for payment, held for investigation or returned for correction?
One record to trace
Purchase order item 4507000232_00010 is followed through invoice receipt, goods receipt, clearing and the final payment decision.
Current maturity
Native SQL and Python build validated with 21 passing controls, complete event and item counts and a reproducible rebuild.
Inspect Purchase Order, Receipt and Invoice Reconciliation
Executed purchase order, receipt and invoice reconciliation showing supported items, payment holds and responsible review teams

Evidence comparison

How each build proves its figures.

The wholesale mart reconciles invoice, purchase and stock facts after a clean rebuild. The purchase-to-pay model checks complete event and item counts, unique classification, payment decisions and one item-level trace.

Reporting mart

SQL-backed Reporting Foundation

Platform
Microsoft Wide World Importers with a portable DuckDB reporting mart
Data scale
228,265 invoice lines, 8,367 purchase order lines and 236,667 stock movements across 41 business months
Record trace
InvoiceLineID 1 is followed from Sales.InvoiceLines through staging, shared keys, the sales fact, validation and the monthly revenue measure.
Boundary
The Microsoft sample does not prove a production database, live refresh or customer scale.
Build status
Native build validated with 18 passing controls and a repeatable clean rebuild.

Reconciliation control

Purchase Order, Receipt and Invoice Reconciliation

Platform
BPI Challenge 2019 with a SQL and Python matching build
Data scale
251,734 purchase order items and 1,595,923 events from the complete BPI Challenge 2019 event log, verified
Record trace
Purchase order item 4507000232_00010 is followed through invoice receipt, goods receipt, clearing and the final payment decision.
Boundary
The historical anonymised event log supports matching and process analysis; it does not prove a live payment control or the anonymised organisation’s current performance.
Build status
Native SQL and Python build validated with 21 passing controls, complete event and item counts and a reproducible rebuild.

Continue from the evidence

Start with the commercial reporting problem or inspect the technical practices used to build and check these examples.

Capabilities

SQLModel grains, transformations, tests and reporting marts.
Excel and Power QueryControl file preparation when a workbook remains the right operating tool.

Start with one disputed figure

Trace the figures that are hardest to explain.

Bring the current files, one disputed result and the checks already in use. The first conversation does not require confidential or protected data.

Discuss a reporting foundation