data-products.internal

Data Products

what newvolt-data-platform serves from its gold layer · queries in 2026-08
All
Finance
Commercial
Marketing
Operations
Data science
Trading
release 1.1.0
order lines, orders and Finance's trading measures; the table the Monday trading pack sums
obt_order_lines · fact_order_lines · fact_orders · metric_trading · dim_date
Finance5 tables2,480 queries
Customers
one row per shop account, the channel it signed up on and its country; guests as unknown
dim_customers · dim_countries · dim_channels
Marketing3 tables331 queries
Products
one row per SKU with brand, category and family, and the margin by product family
dim_products · rpt_margin_by_family
Commercial2 tables381 queries
Delivery
one row per shipment with the carrier, the promise and the delivery day, and the daily SLA
fact_shipments · dim_carriers · rpt_delivery_sla · metric_service
Operations4 tables338 queries
Returns
one row per returned line with the reason and the refund, and the returns by month and reason
fact_returns · dim_return_reasons · rpt_returns_by_reason
Operations3 tables104 queries
Stock and purchasing
stock per SKU and day, purchase orders, the suppliers and their fill rate by month
fact_stock_daily · fact_purchases · dim_suppliers · rpt_supplier_fill_rate
Operations4 tables70 queries
Campaigns
one row per approved campaign window, and the discount offers of the old promotions table
dim_campaigns · dim_promotions_old
Marketing2 tables34 queries
Daily sales
deprecated
order lines read straight from bronze; replaced by the one big table on 2026-07-31
rpt_daily_sales_wide
Finance1 table5 queries

Trading

release 1.1.0 · active
order lines, orders and Finance's trading measures; the table the Monday trading pack sums
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract
release
1.1.0
2026-10-07
grain
one order line
cancelled orders left out
data through
2026-08-31
the last day delivered
ready by
07:00 UTC
daily, the SLA

Tables

5 tables · gold_marts
table
kind
rows
size
last update
obt_order_lines
one big table
12,418,906
820 MB
2026-09-01 05:42
open →
fact_order_lines
fact
12,646,385
610 MB
2026-09-01 05:42
fact_orders
fact
5,248,906
190 MB
2026-09-01 05:42
metric_trading
metric
12,892
view
2026-09-01 05:42
dim_date
dimension
4,018
1 MB
2026-09-01 05:42

Read by

5 roles in ops/query_logs.csv
finance_analyst
Finance
net revenue, margin and the month end
commercial_analyst
Commercial
sales by brand, category and SKU
marketing_analyst
Marketing
new, returning and guest orders
data_scientist
Data Science
the detail behind a model, read-only
monday_pack
the BI service
the Monday trading pack, safe to sum
docs/data-products/obt_order_lines/model.mdwritten by /data-product · 2026-10-07
DIMENSION
dim_date
date_keyPK
calendar_date
year_month
day_name
+ 9 columns
DIMENSION · CUSTOMERS
dim_customers
customer_idPK
home_countryFK
signup_channelFK
is_business
+ 6 columns
FACT
fact_order_lines
line_idPK
date_keyFK
customer_idFK
skuFK
is_cancelled
net_eur
+ 12 columns
DIMENSION · PRODUCTS
dim_products
skuPK
product_name
brand
category
+ 8 columns
FACT
fact_orders
order_idPK
date_keyFK
customer_idFK
campaign_idFK
is_cancelled
net_eur
+ 4 columns
ONE BIG TABLE
obt_order_lines
line_idPK
order_id
ordered_on
net_eur
+ 19 columns
METRIC
metric_trading
order_month
ship_country
net_revenue_eur
orders
+ 9 columns
date_key
customer_id
sku
flattened
built from
customer_id

One row is

5 tables
table
one row is
key
joins on
obt_order_lines
an order line of an order that was not cancelled
line_id
flattened from the fact and its dimensions
fact_order_lines
an order line, cancelled ones included
line_id
date_key, customer_id, sku
fact_orders
an accepted order, cancelled ones included
order_id
date_key, customer_id, campaign_id
metric_trading
a month, market, channel, customer type and category, with Finance's measures
the 5 columns
the same 5 columns, summed
dim_date
a calendar day
date_key
ordered_on = calendar_date

Grain rules

One order has one or more lines. Count orders with count(DISTINCT order_id).
One account has many orders. Count customers with count(DISTINCT customer_id), and leave out unknown.
A product has one row in dim_products. Its price and cost have many versions in silver_core; the table already took the one valid on the order day.
docs/data-products/obt_order_lines/tour.mdwritten by /data-product · 2026-10-07
Your first hour with obt_order_lines
1What it is5 min
2What to trust10 min
3Open it5 min
4Run 3 starter queries30 min
5When something looks wrong10 min
6Whom to ask

For a new consumer: an analyst, a team lead, a new member of Finance. Read this once, run the 3 queries, and you have the numbers of the Monday trading pack: net revenue, orders and margin by month, market and category.

1What it is5 min

One row per order line of an order that was not cancelled, with its day, customer and product beside it. 12,418,906 rows, from 2022-01-01 to 2026-08-31. It lives in the warehouse as gold_marts.obt_order_lines, and it is rebuilt by every run that succeeds, daily from 05:30 UTC.

2What to trust10 min

Sum the money, never the counts. sum(net_eur) is Finance's net revenue for any selection. Orders and customers are count(DISTINCT ...), recomputed for each selection.
Cancelled orders are already out. Do not filter on status; there is none.
Euros without VAT. No shipping, no refunds. Net revenue is not what the customer paid at checkout.
The day is the UTC day of the checkout. An order placed at 01:30 in Berlin belongs to the day before.
Guests are unknown. They have no account, so they share one customer_id.
The data is as good as the last run that succeeded. When a delivery is late, the gold tasks are skipped and consumers read the gold of the last run that built it. A wrong file or row is quarantined and the rest of the day is built; the Quality tab lists both.

3Open it5 min

Read-only, and never while the daily run is writing. In Python:

import duckdb
con = duckdb.connect("data/warehouse/newvolt.duckdb", read_only=True)
con.sql("SELECT count(*) FROM gold_marts.obt_order_lines").show()

If it says the file is locked, a run is writing. Wait until the run has finished, about 12 min after 05:30 UTC. More in knowledge/connections.md.

4Run 3 starter queries30 min

Net revenue by month · query 1EUR 51,276,728.4097,030 orders · EUR 528.46 per order
The month by market · query 2EUR 21,934,110.52Germany, 39,780 of the month's orders
Margin by category · query 4EUR 7,036,218.5213.7 percent of the month's net revenue

If your numbers differ from these, the table was rebuilt since this page was written, or your filter differs. Ask before you report.

5When something looks wrong10 min

First the known issues. It may be known, with a workaround.
Then the Quality tab, or the Runs page. When the gold tasks of a run were skipped, the newest day is not in.
Then write to the data engineer, with your query and the number you expected. Your correction goes into corrections.md.

6Whom to ask

question
who
address
What a measure means
Finance
Finance team
A number that looks wrong
the data engineer
data engineering team
A product, a price, a listing
Commercial
Commercial team
A campaign or a voucher
Marketing
Marketing team
docs/data-products/obt_order_lines/metrics.mdwritten by /data-product · 2026-10-07
draft for FinanceFinance signs them · 8 of the 12 are also in the view gold_marts.metric_trading
measure
formula on this table
sums across rows
Finance's words
Gross merchandise
sum(gross_eur)
yes
quantity times list price, before discount
Discount
sum(discount_eur)
yes
the whole-line discount
Net revenue
sum(net_eur)
yes
line net after discount; excludes shipping and refunds
Units sold
sum(quantity)
yes
the ordered units of the selected lines
Orders
count(DISTINCT order_id)
no: an order can sit in 2 categories
distinct non-cancelled order references
Average order value
sum(net_eur) / count(DISTINCT order_id)
no: recompute per selection
selected net revenue divided by selected distinct orders
Weighted discount
sum(discount_eur) / sum(gross_eur)
no
total line discount divided by gross merchandise
Standard cost
sum(standard_cost_eur)
yes
units sold times the dated standard cost
Margin
sum(net_eur) - sum(standard_cost_eur)
yes
net revenue minus units sold times dated standard cost
Margin percent
(sum(net_eur) - sum(standard_cost_eur)) / sum(net_eur)
no
margin divided by net revenue
Registered customers
count(DISTINCT customer_id) FILTER (WHERE customer_id <> 'unknown')
no
accounts with a selected order; distinct within the selection
Guest share of orders
count(DISTINCT order_id) FILTER (WHERE customer_type = 'guest') / count(DISTINCT order_id)
no
guest orders divided by all orders

Rules for every measure

A zero denominator gives a blank, never a percentage. nullif(..., 0) in every ratio.
Never add counts. In 2026-08 the orders of the 6 markets add to 97,030 only because an order ships to 1 country; the orders of the 5 categories add to 118,276, because an order with a cable and a laptop counts in both.
The day is the UTC day of the checkout. ordered_on and order_month come from it. Refund postings and cash dates are other time bases and are not in this table.
Year on year compares the same days. A new product with no sales a year before has no growth percentage.

Not here, on purpose

4 measures
measure
why not
where it will come from
Margin after refunds
refunds arrive up to 60 days after the sale and would change closed months
a join of this table with gold_marts.fact_returns on line_id; open in the decision log
Order-return rate
returns are not in this table
gold_marts.fact_returns, the Returns product
Recorded order contribution
needs shipping fees, refunds and parcel expense
not built
Target attainment
needs sales_targets
the clean table, by month and country

What is in, what is out

business-logic.md
in the table
one row per order lineline_id is the key
booked ordersstatus 10 and 25 count; not statutory revenue
history from 2022-01-01earlier trading is outside the data
the UTC day of the checkout23:30 UTC on 2026-08-19 is 2026-08-19
euros without VATconverted once from whole cents
the standard cost of the order daynever the current cost
the campaign windowthe discount says whether an offer was used
not in the table
cancelled ordersstatus 90; so a plain sum is the trading number
the shipping feeper order; shipping_fee_cents in silver_clean.orders
refunds and returnsmargin is before refunds
VATthe German shop shows 19 percent VAT; this table never shows VAT
names, emails, years of birththey stay in silver_core.customers
cities and postal codesremoved in 1.1.0; in gold_marts.dim_customers
the current cost on an old salestandard_cost_eur holds the cost of the day
docs/data-products/obt_order_lines/starter-queries.sqlwritten by /data-product · 2026-10-07
10 queriesfrom ops/query_logs.csv and the corrections consumers sent
1Net revenue by month
2The month by market
32026-08 against 2025-08
4Margin by category
5New, returning and guest
6Top 10 products
7Discount by channel
8Campaign windows
9Customers and guest share
10One order, line by line
1
Net revenue, orders and average order value by month
one row per month
SELECT
  order_month,
  sum(net_eur)                                                  AS net_revenue_eur,
  count(DISTINCT order_id)                                      AS orders,
  round(sum(net_eur) / nullif(count(DISTINCT order_id), 0), 2)  AS average_order_value_eur
FROM gold_marts.obt_order_lines
WHERE order_month >= '2026-01'
GROUP BY order_month
ORDER BY order_month;
Result8 rows · as run on 2026-10-07
order_month
net_revenue_eur
orders
average_order_value_eur
2026-01
48,076,758.96
104,632
459.48
2026-02
36,972,587.01
71,021
520.59
2026-03
47,816,213.46
90,311
529.46
2026-04
45,909,425.22
89,795
511.27
2026-05
52,303,291.17
101,455
515.53
2026-06
52,655,239.23
100,614
523.34
2026-07
44,882,531.34
80,605
556.82
2026-08
51,276,728.40
97,030
528.46
2
The month by market: where the orders shipped to
one row per ship country
SELECT
  ship_country,
  count(DISTINCT order_id)  AS orders,
  sum(net_eur)              AS net_revenue_eur
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY ship_country
ORDER BY net_revenue_eur DESC;
Result6 rows · as run on 2026-10-07
ship_country
orders
net_revenue_eur
DE
39,780
21,934,110.52
FR
17,180
9,021,604.80
NL
11,981
6,391,880.16
AT
10,388
5,409,224.00
IT
9,436
4,816,117.12
ES
8,265
3,703,791.80
3
The same month a year before, the same days
one row per year
SELECT
  order_year,
  sum(net_eur)              AS net_revenue_eur,
  count(DISTINCT order_id)  AS orders
FROM gold_marts.obt_order_lines
WHERE month(ordered_on) = 8
  AND order_year IN (2025, 2026)
GROUP BY order_year
ORDER BY order_year;
Result2 rows · as run on 2026-10-07
order_year
net_revenue_eur
orders
2025
51,925,498.33
110,550
2026
51,276,728.40
97,030
4
Margin by category
one row per category; margin is net revenue minus the cost of the order day
SELECT
  category,
  sum(net_eur)                                 AS net_revenue_eur,
  sum(standard_cost_eur)                       AS standard_cost_eur,
  sum(net_eur) - sum(standard_cost_eur)        AS margin_eur,
  round((sum(net_eur) - sum(standard_cost_eur))
        / nullif(sum(net_eur), 0), 4)          AS margin_pct
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY category
ORDER BY margin_eur DESC;
Result5 rows · as run on 2026-10-07
category
net_revenue_eur
standard_cost_eur
margin_eur
margin_pct
Phones and Tablets
18,462,906.15
16,363,396.78
2,099,509.37
0.1137
Accessories
7,182,406.15
5,448,989.88
1,733,416.27
0.2413
Computers
14,918,377.42
13,450,662.69
1,467,714.73
0.0984
Monitors
6,408,219.90
5,430,665.18
977,554.72
0.1525
Audio
4,304,818.78
3,546,795.35
758,023.43
0.1761
5
New, returning and guest orders
one row per customer type; Finance's type, set at checkout
SELECT
  customer_type,
  count(DISTINCT order_id)  AS orders,
  sum(net_eur)              AS net_revenue_eur
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY customer_type
ORDER BY customer_type;
Result3 rows · as run on 2026-10-07
customer_type
orders
net_revenue_eur
guest
12,529
6,703,067.26
new
20,049
10,898,631.59
returning
64,452
33,675,029.55
6
The 10 products with the highest net revenue in the month
one row per product
SELECT
  sku,
  product_name,
  brand,
  sum(quantity)  AS units,
  sum(net_eur)   AS net_revenue_eur
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY sku, product_name, brand
ORDER BY net_revenue_eur DESC
LIMIT 10;
Result10 rows · as run on 2026-10-07
sku
product_name
brand
units
net_revenue_eur
PA-11001
Pavo One 8 Phone 128GB
Pavo
11,790
2,733,315.29
PA-12001
Pavo One 8 Phone 128GB (silver)
Pavo
8,498
1,713,892.29
KO-25003
Kova G3-1740 15.6 Laptop 16GB/1024GB
Kova
1,668
1,620,792.95
PA-13001
Pavo One 8 Phone 256GB White
Pavo
5,450
1,485,920.67
KO-24603
Kova K7-1890 15.6 Laptop 32GB/1024GB (green)
Kova
957
1,083,056.66
KO-23303
Kova K5-1440 14 Laptop 16GB/512GB White
Kova
1,513
1,077,220.47
KA-17003
Kaivo X 15 Gen 3 Phone 256GB Red
Kaivo
1,624
970,514.10
KA-12003
Kaivo Pro 10 Gen 3 Phone 64GB (silver)
Kaivo
2,425
914,208.96
KO-21603
Kova K3-1890 15.6 Laptop 32GB/1024GB (green)
Kova
979
914,099.79
KO-27003
Kova G3-2040 16 Laptop 32GB/1024GB Red
Kova
845
878,536.08
7
The weighted discount by channel
one row per channel; the whole discount over the whole gross
SELECT
  channel,
  sum(gross_eur)                                           AS gross_merchandise_eur,
  sum(discount_eur)                                        AS discount_eur,
  round(sum(discount_eur) / nullif(sum(gross_eur), 0), 4)  AS weighted_discount
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY channel
ORDER BY gross_merchandise_eur DESC;
Result3 rows · as run on 2026-10-07
channel
gross_merchandise_eur
discount_eur
weighted_discount
web
36,471,259.13
3,508,953.74
0.0962
app
19,057,359.81
1,737,561.01
0.0912
marketplace
1,088,872.01
94,247.80
0.0866
8
Orders inside a campaign window
one row per campaign; a window is not proof an offer was used
SELECT
  campaign_id,
  count(DISTINCT order_id)  AS orders,
  sum(discount_eur)         AS discount_eur,
  sum(net_eur)              AS net_revenue_eur
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
  AND campaign_id IS NOT NULL
GROUP BY campaign_id
ORDER BY orders DESC;
Result3 rows · as run on 2026-10-07
campaign_id
orders
discount_eur
net_revenue_eur
BTS2026
50,687
4,318,512.25
26,249,196.17
WB20260803
1,819
144,022.02
1,144,746.05
WB20260720
855
49,309.05
425,443.67
9
Registered customers in the month, and the guest share of orders
one row
SELECT
  count(DISTINCT customer_id) FILTER (WHERE customer_id <> 'unknown')
    AS registered_customers,
  round(count(DISTINCT order_id) FILTER (WHERE customer_type = 'guest')
        / nullif(count(DISTINCT order_id), 0), 4)
    AS guest_share_of_orders
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08';
Result1 row · as run on 2026-10-07
registered_customers
guest_share_of_orders
78,433
0.1291
10
One order, line by line: to check a number against the shop
one row per line
SELECT
  line_id, ordered_on, sku, product_name,
  quantity, gross_eur, discount_eur, net_eur
FROM gold_marts.obt_order_lines
WHERE order_id = 'SO372035'
ORDER BY line_id;
Result1 row · as run on 2026-10-07
column
value
line_id
SO372035-01
ordered_on
2026-08-01
sku
KO-26003
product_name
Kova G3-1890 15.6 Laptop 32GB/1024GB (green)
quantity
1
gross_eur
949.57
discount_eur
0.00
net_eur
949.57
docs/data-products/obt_order_lines/known-issues.md · health.md · consumer-safe.mdwritten by /data-product · 2026-10-07
data through
2026-08-31
the last day delivered
last build
2026-09-01 05:42
succeeded in 12 min 12 s
the month
final
41 of 41 tables reconciled
checks · last run
28 passed
3 warned, 0 failed
known issues
5 open
3 closed

Known issues

8 issues, newest first
issue
workaround
owner
status
212 of 1,106 queries on fact_order_lines in 2026-08 sum net_eur without NOT is_cancelled and overstate the month by EUR 646,086.78, 1.26 percent
read obt_order_lines, or add NOT is_cancelled
the data engineer
open since 2026-10-07
the 4 euro columns are DOUBLE in the warehouse, not DECIMAL(18,2) as the contract says
round(sum(net_eur), 2); a sum can print 51276728.400000013
the data engineer, task t15
open since 1.0.0
no refunds in the table: margin is before refunds, and returns arrive up to 60 days after the sale
for refunds, read gold_marts.fact_returns, refund_eur
the data engineer and Finance
open
home_country is the country of the account, not the market of the sale
use ship_country for sales by market
the data engineer
open, by design
acquisition_source is marketplace on every marketplace order; the marketplace reports no source
compare sources within a channel
Marketing
open, by design
city and postal_code in the one big table, personal detail no consumer read
do not read them from this table
the data engineer
closed 2026-10-07
the gold tasks were skipped on 6 days: 2026-08-12 to 2026-08-15 and 2026-08-18 after complete_feed failed, 2026-08-19 after silver_clean failed on orders
consumers read the gold of 2026-08-11 and 2026-08-17; the changes loaded on 2026-08-16 and 2026-08-20
Data Platform
closed 2026-08-20
a duplicate delivery of one order carried a delivered status 6 days before the shipment; unique_sequence quarantined it on 2026-08-08
the first copy stood; the changed copy is in ops/quarantine/
Data Platform
closed 2026-08-11

No personal data

checked for release 1.1.0
data
where it stays
since
first name, last name
silver_core.customers
always
email address, year of birth
silver_core.customers, silver_clean.contacts
always
city, postal code
gold_marts.dim_customers, for the regional analysis
removed from this table in 1.1.0
support messages
silver_clean.messages
always

Safe to sum

6 checks
check
result
how it is checked
cancelled orders are out
0 cancelled lines
the table filters them; the contract counts them
one row per line
12,418,906 lines, 12,418,906 keys
the contract's quality rule on line_id
money is exact
DECIMAL(18,2) in the contract; DOUBLE in the warehouse, a known issue
round every total to the cent
no double counting
one row per line, no join that multiplies
the joins are on the dimensions' keys
no VAT, shipping or refunds mixed in
net_eur is net revenue only
said in every amount's description
the cost of the day
standard_cost_eur from the cost valid on ordered_on
an as-of join in core, never an aggregate
docs/data-products/obt_order_lines/release-notes.md · number-diff.md · deprecation.mdwritten by /data-product · 2026-10-07
1.1.02026-10-07
No personal data in the table, and every column described in contract.yaml.
Removedcity and postal_code; personal detail the one big table does not need, read by no query of 2026-08; they stay in gold_marts.dim_customers
Changedevery column has a description, a sensitivity tag and, for a measure, an additivity tag in contract.yaml; 2026-08 is complete and final
Fixedthe description of net_eur said "with shipping"; it never included shipping. Thanks to Finance
What you must doa query that reads city or postal_code from this table fails from 2026-10-07; join gold_marts.dim_customers on customer_id instead
1.0.02026-08-01
The first release, built on the baseline of 2026-07-31.
Addedgold_marts.obt_order_lines, the star flattened, 25 columns: cancelled orders out, money in euros without VAT, the standard cost of the order day, the contract, the tour, the starter queries
What you must donothing

The number diff, 1.0.0 to 1.1.0

releases/1.1.0.json
number
1.0.0 · 2026-08-01
1.1.0 · 2026-10-07
change
rows
12,187,491
12,418,906
+231,415 · +1.90 %
orders
5,044,178
5,141,206
+97,028 · +1.92 %
sum of net_eur
2,567,171,039.98
2,618,447,309.62
+51,276,269.64 · +2.00 %
2026-08 is new: 231,418 lines and 97,030 orders, EUR 51,276,728.40 of net revenue, accepted by the gates and reconciled with the export on 2026-08-31.
2026-07 lost 2 orders and EUR 458.76: an order of 2026-07-30, EUR 436.92, and an order of 2026-07-31, EUR 21.84, were cancelled in 2026-08.
2026-05 and 2026-06 did not move, to the cent.

The deprecation notice, as sent

2026-09-26 · 5 roles
to finance_analyst, marketing_analyst, commercial_analyst, data_scientist and monday_pack
Subject: obt_order_lines loses city and postal_code on 2026-10-07

From release 1.1.0 on 2026-10-07, gold_marts.obt_order_lines no longer carries city and postal_code. The one big table is read by 5 roles, and personal detail belongs where few people read it. None of the queries of 2026-08 read them. A query outside the log keeps working when it joins gold_marts.dim_customers, as below. Nothing else in the table changes.

-- Before, until 1.0.0
SELECT postal_code, sum(net_eur) AS net_revenue_eur
FROM gold_marts.obt_order_lines
WHERE order_month = '2026-08'
GROUP BY postal_code;

-- After, from 1.1.0: the postal code comes from the customer dimension
SELECT customers.postal_code, sum(lines.net_eur) AS net_revenue_eur
FROM gold_marts.obt_order_lines AS lines
JOIN gold_marts.dim_customers AS customers
  ON customers.customer_id = lines.customer_id
WHERE lines.order_month = '2026-08'
GROUP BY customers.postal_code;

What consumers reported

corrections.md
day
from
what they said
what changed
2026-10-05
Operations
guest orders show the customer unknown, so 1 customer was counted too many
the tour says: leave out unknown when counting customers; query 9 does it
2026-10-02
Finance
a margin query joined the current standard cost to old sales
standard_cost_eur already holds the cost of the order day; query 4
2026-10-01
Commercial
adding up the orders of each category gave more orders than the month had
orders are counted, not added; 118,276 against 97,030 in 2026-08
2026-09-29
Finance
the description of net_eur said "with shipping"
fixed in 1.1.0: net revenue excludes shipping and refunds
docs/data-products/obt_order_lines/contract.yamlwritten by /data-product · 2026-10-07
Contractcontract.yaml
ODCS 3.1.0
idnewvolt-obt-order-lines
version1.1.0 · active
ownerthe data engineer
stewardFinance
serverduckdb · gold_marts
built bypipeline/gold/marts/obt_order_lines.sql

What it is for

description
purposeOne row per order line of an order that was not cancelled, with its day, customer and product beside it. The table the Monday trading pack and the analysts sum.
usageSum the measures freely: cancelled orders are out, so a plain sum gives Finance's trading number. Count orders and customers with count(DISTINCT ...), never by adding counts.
limitationsNo refunds, no returns, no shipping fees: net_eur is net revenue only. Amounts exclude VAT. History starts on 2022-01-01. Guest checkouts share the customer_id unknown.

Service levels

4 properties
property
value
description
frequency
1 d
Rebuilt by every run that succeeds. When the gold tasks are skipped, consumers read the gold of the last run that built it.
latency
1 d
The data of day D is in the table by 07:00 UTC on D+1, when D's delivery passed its gates.
retention
all
Every order since 2022-01-01. Nothing is rolled off.
timeOfAvailability
07:00
UTC, for the Monday trading pack.

Quality rules

4 rules, each must be 0
rule
query
must be
One row per line.
SELECT count(*) - count(DISTINCT line_id)
FROM gold_marts.obt_order_lines
0
No line of a cancelled order.
SELECT count(*)
FROM gold_marts.obt_order_lines
JOIN silver_core.orders USING (order_id)
WHERE is_cancelled
0
The net revenue equals the fact's, for orders that were not cancelled.
SELECT round(abs(
  (SELECT sum(net_eur) FROM gold_marts.obt_order_lines)
  - (SELECT sum(net_eur) FROM gold_marts.fact_order_lines
     WHERE NOT is_cancelled)), 2)
0
Every line has a cost from the day it was ordered.
SELECT count(*)
FROM gold_marts.obt_order_lines
WHERE standard_cost_eur IS NULL
0

Schema

23 columns
column
type
required
tags
description
line_id PK
VARCHAR
yes
internal
The order line number, like SO372035-01. The key.
order_id
VARCHAR
yes
internal
The order the line belongs to. Several lines share one order.
ordered_on
DATE
yes
public
The day the order was placed, the UTC day of the checkout.
order_month
VARCHAR
yes
public
The month the order was placed, like 2026-08.
order_year
BIGINT
yes
publicnon additive
The year the order was placed.
customer_id
VARCHAR
yes
internal
The shop account that ordered, or unknown for a guest checkout. An account is not always one person.
customer_type
VARCHAR
yes
internal
Finance's customer type at placement: guest, new or returning. Set at checkout, never recalculated.
home_country
VARCHAR
no
internal
The country of the customer's account, as an ISO 3166-1 alpha-2 code. Missing for a guest. Not where the order was sent.
signup_channel
VARCHAR
no
internal
Where the account was created: web or app. Missing for a guest.
is_business
BOOLEAN
no
internal
True when the account belongs to a business account. Missing for a guest.
sku
VARCHAR
yes
public
The product on the line, one physical variant.
product_name
VARCHAR
yes
public
The name of the product. It does not always say the colour.
brand
VARCHAR
yes
public
The brand: Kaivo, Kova, Nodo, Ondia, Pavo or Visna.
category
VARCHAR
yes
public
The category: Phones and Tablets, Computers, Monitors, Accessories or Audio.
ship_country
VARCHAR
yes
public
The country the order ships to, as an ISO 3166-1 alpha-2 code. The market of the sale.
channel
VARCHAR
yes
public
Where the order was placed: web, app or marketplace.
acquisition_source
VARCHAR
no
internal
The last touch that brought the checkout, as the shop recorded it. Always marketplace on a marketplace order.
campaign_id
VARCHAR
no
internal
The campaign window the order fell in, if any. It does not prove an offer was used.
quantity
INTEGER
yes
internaladditive
The ordered units on the line.
gross_eur
DECIMAL(18,2)
yes
internaladditive
Quantity times list price, before any discount, in euros without VAT.
discount_eur
DECIMAL(18,2)
yes
internaladditive
The whole discount on the line, in euros without VAT.
net_eur
DECIMAL(18,2)
yes
internaladditive
What the line is worth after the discount, in euros without VAT. Net revenue: no shipping, no refunds.
standard_cost_eur
DECIMAL(18,2)
yes
internaladditive
Quantity times the standard cost valid on the order day, in euros.
# The data contract of gold_marts.obt_order_lines: what the consumers of the one big table can rely on.
# Format: the open standard ODCS, version 3.1.0, as the source contracts in contracts/. Written by the data-product skill,
# owned by the data engineer, the definitions signed by Finance. A change to a column is a new version and a release note.
kind: DataContract
apiVersion: v3.1.0
id: newvolt-obt-order-lines
name: obt_order_lines
version: 1.1.0
status: active
description:
purpose: "One row per order line of an order that was not cancelled, with its day, customer and product beside it. The table the Monday trading pack and the analysts sum."
usage: "Sum the measures freely: cancelled orders are out, so a plain sum gives Finance's trading number. Count orders and customers with count(DISTINCT ...), never by adding counts."
limitations: "No refunds, no returns, no shipping fees: net_eur is net revenue only. Amounts exclude VAT. History starts on 2022-01-01. Guest checkouts share the customer_id unknown."
servers:
- {server: newvolt, type: duckdb, database: data/warehouse/newvolt.duckdb, schema: gold_marts, description: "Open it read-only, between runs. See knowledge/connections.md."}
team:
name: data-platform
members:
- {username: data-engineering, name: "the data engineer", role: owner, description: "Builds the table, answers for the data."}
- {username: finance, name: Finance, role: steward, description: "Owns the definitions of the measures, signs them."}
slaProperties:
- {property: frequency, value: 1, unit: d, description: "Rebuilt by every run that succeeds. When the gold tasks are skipped, consumers read the gold of the last run that built it."}
- {property: latency, value: 1, unit: d, description: "The data of day D is in the table by 07:00 UTC on D+1, when D's delivery passed its gates."}
- {property: retention, value: all, description: "Every order since 2022-01-01. Nothing is rolled off."}
- {property: timeOfAvailability, value: "07:00", description: "UTC, for the Monday trading pack."}
customProperties:
- {property: grain, value: "one order line of an order that was not cancelled"}
- {property: builtBy, value: pipeline/gold/marts/obt_order_lines.sql}
- {property: consumers, value: "monday_pack, finance analysts, commercial analysts, marketing analysts"}
- {property: docs, value: docs/data-products/obt_order_lines/}
schema:
- name: obt_order_lines
physicalName: gold_marts.obt_order_lines
physicalType: table
description: "One row per order line of an order that was not cancelled, with the day, the customer and the product beside it."
quality:
- {type: sql, description: "One row per line.", query: "SELECT count(*) - count(DISTINCT line_id) FROM gold_marts.obt_order_lines", mustBe: 0}
- {type: sql, description: "No line of a cancelled order.", query: "SELECT count(*) FROM gold_marts.obt_order_lines JOIN silver_core.orders USING (order_id) WHERE is_cancelled", mustBe: 0}
- {type: sql, description: "The net revenue equals the fact's, for orders that were not cancelled.", query: "SELECT round(abs((SELECT sum(net_eur) FROM gold_marts.obt_order_lines) - (SELECT sum(net_eur) FROM gold_marts.fact_order_lines WHERE NOT is_cancelled)), 2)", mustBe: 0}
- {type: sql, description: "Every line has a cost from the day it was ordered.", query: "SELECT count(*) FROM gold_marts.obt_order_lines WHERE standard_cost_eur IS NULL", mustBe: 0}
properties:
- {name: line_id, logicalType: string, physicalType: VARCHAR, required: true, primaryKey: true, primaryKeyPosition: 1, description: "The order line number, like SO372035-01. The key.", customProperties: [{property: sensitivity, value: internal}]}
- {name: order_id, logicalType: string, physicalType: VARCHAR, required: true, description: "The order the line belongs to. Several lines share one order.", customProperties: [{property: sensitivity, value: internal}]}
- {name: ordered_on, logicalType: date, physicalType: DATE, required: true, description: "The day the order was placed, the UTC day of the checkout.", customProperties: [{property: sensitivity, value: public}]}
- {name: order_month, logicalType: string, physicalType: VARCHAR, required: true, description: "The month the order was placed, like 2026-08.", customProperties: [{property: sensitivity, value: public}]}
- {name: order_year, logicalType: integer, physicalType: BIGINT, required: true, description: "The year the order was placed.", customProperties: [{property: sensitivity, value: public}, {property: additivity, value: non_additive}]}
- {name: customer_id, logicalType: string, physicalType: VARCHAR, required: true, description: "The shop account that ordered, or unknown for a guest checkout. An account is not always one person.", customProperties: [{property: sensitivity, value: internal}]}
- {name: customer_type, logicalType: string, physicalType: VARCHAR, required: true, description: "Finance's customer type at placement: guest, new or returning. Set at checkout, never recalculated.", customProperties: [{property: sensitivity, value: internal}]}
- {name: home_country, logicalType: string, physicalType: VARCHAR, required: false, description: "The country of the customer's account, as an ISO 3166-1 alpha-2 code. Missing for a guest. Not where the order was sent.", customProperties: [{property: sensitivity, value: internal}]}
- {name: signup_channel, logicalType: string, physicalType: VARCHAR, required: false, description: "Where the account was created: web or app. Missing for a guest.", customProperties: [{property: sensitivity, value: internal}]}
- {name: is_business, logicalType: boolean, physicalType: BOOLEAN, required: false, description: "True when the account belongs to a business account. Missing for a guest.", customProperties: [{property: sensitivity, value: internal}]}
- {name: sku, logicalType: string, physicalType: VARCHAR, required: true, description: "The product on the line, one physical variant.", customProperties: [{property: sensitivity, value: public}]}
- {name: product_name, logicalType: string, physicalType: VARCHAR, required: true, description: "The name of the product. It does not always say the colour.", customProperties: [{property: sensitivity, value: public}]}
- {name: brand, logicalType: string, physicalType: VARCHAR, required: true, description: "The brand: Kaivo, Kova, Nodo, Ondia, Pavo or Visna.", customProperties: [{property: sensitivity, value: public}]}
- {name: category, logicalType: string, physicalType: VARCHAR, required: true, description: "The category: Phones and Tablets, Computers, Monitors, Accessories or Audio.", customProperties: [{property: sensitivity, value: public}]}
- {name: ship_country, logicalType: string, physicalType: VARCHAR, required: true, description: "The country the order ships to, as an ISO 3166-1 alpha-2 code. The market of the sale.", customProperties: [{property: sensitivity, value: public}]}
- {name: channel, logicalType: string, physicalType: VARCHAR, required: true, description: "Where the order was placed: web, app or marketplace.", customProperties: [{property: sensitivity, value: public}]}
- {name: acquisition_source, logicalType: string, physicalType: VARCHAR, required: false, description: "The last touch that brought the checkout, as the shop recorded it. Always marketplace on a marketplace order.", customProperties: [{property: sensitivity, value: internal}]}
- {name: campaign_id, logicalType: string, physicalType: VARCHAR, required: false, description: "The campaign window the order fell in, if any. It does not prove an offer was used.", customProperties: [{property: sensitivity, value: internal}]}
- {name: quantity, logicalType: integer, physicalType: INTEGER, required: true, description: "The ordered units on the line.", customProperties: [{property: sensitivity, value: internal}, {property: additivity, value: additive}]}
- {name: gross_eur, logicalType: number, physicalType: "DECIMAL(18,2)", required: true, description: "Quantity times list price, before any discount, in euros without VAT.", customProperties: [{property: sensitivity, value: internal}, {property: additivity, value: additive}]}
- {name: discount_eur, logicalType: number, physicalType: "DECIMAL(18,2)", required: true, description: "The whole discount on the line, in euros without VAT.", customProperties: [{property: sensitivity, value: internal}, {property: additivity, value: additive}]}
- {name: net_eur, logicalType: number, physicalType: "DECIMAL(18,2)", required: true, description: "What the line is worth after the discount, in euros without VAT. Net revenue: no shipping, no refunds.", customProperties: [{property: sensitivity, value: internal}, {property: additivity, value: additive}]}
- {name: standard_cost_eur, logicalType: number, physicalType: "DECIMAL(18,2)", required: true, description: "Quantity times the standard cost valid on the order day, in euros.", customProperties: [{property: sensitivity, value: internal}, {property: additivity, value: additive}]}
YAML · ODCS 3.1.0 · 70 lines · read only
tables5
size1.6 GB
queries · 2026-082,480
last update2026-09-01 05:42
read byFinanceCommercialMarketingData science
FI
Finance
steward, signs the definitions
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Customers

Customers

no data contract
one row per shop account, the channel it signed up on and its country; guests as unknown
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

3 tables · gold_marts
table
kind
rows
size
last update
dim_customers
dimension
1,842,310
48 MB
2026-09-01 05:42
dim_countries
dimension
27
1 MB
2026-09-01 05:42
dim_channels
dimension
3
1 MB
2026-09-01 05:42

Read by

2 roles in ops/query_logs.csv
marketing_analyst
Marketing
new, returning and guest customers
data_scientist
Data Science
customer features, read-only
read from the warehouse and the SQL headers
DIMENSION
dim_countries
country_codePK
name
region
currency
DIMENSION
dim_customers
customer_idPK
home_countryFK
signup_channelFK
is_business
+ 6 columns
DIMENSION
dim_channels
channelPK
name
FACT · TRADING
fact_order_lines
line_idPK
date_keyFK
customer_idFK
skuFK
is_cancelled
net_eur
+ 12 columns
FACT · TRADING
fact_orders
order_idPK
date_keyFK
customer_idFK
campaign_idFK
is_cancelled
net_eur
+ 4 columns
home_country
signup_channel
customer_id
customer_id

One row is

3 tables
table
one row is
key
joins on
dim_customers
a shop account, with unknown for guests
customer_id
home_country, signup_channel
dim_countries
a country, ISO 3166-1 alpha-2
country_code
dim_channels
a sales channel: web, app or marketplace
channel
tables3
size50 MB
queries · 2026-08331
last update2026-09-01 05:42
read byMarketingData science
AM
Marketing
head of marketing
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Products

Products

no data contract
one row per SKU with brand, category and family, and the margin by product family
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

2 tables · gold_marts
table
kind
rows
size
last update
dim_products
dimension
9,214
2 MB
2026-09-01 05:42
rpt_margin_by_family
report table
2,304
1 MB
2026-09-01 05:42

Read by

2 roles in ops/query_logs.csv
commercial_analyst
Commercial
launch reviews, brands and categories
finance_analyst
Finance
margin by product family
read from the warehouse and the SQL headers
DIMENSION
dim_products
skuPK
product_name
brand
category
+ 8 columns
FACT · TRADING
fact_order_lines
line_idPK
date_keyFK
customer_idFK
skuFK
is_cancelled
net_eur
+ 12 columns
REPORT TABLE
rpt_margin_by_family
monthPK
family_idPK
net_eur
margin_eur
+ 3 columns
FACT · STOCK AND PURCHASING
fact_stock_daily
date_keyPK
skuPK
on_hand
days_of_cover
+ 1 column
sku
built from
sku

One row is

2 tables
table
one row is
key
joins on
dim_products
a product variant, one SKU
sku
supplier_id
rpt_margin_by_family
a month and a product family
month, family_id
built from fact_order_lines and dim_products
tables2
size3 MB
queries · 2026-08381
last update2026-09-01 05:42
read byCommercialFinance
CO
Commercial
head of commercial
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Delivery

Delivery

no data contract
one row per shipment with the carrier, the promise and the delivery day, and the daily SLA
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

4 tables · gold_marts
table
kind
rows
size
last update
fact_shipments
fact
5,012,884
160 MB
2026-09-01 05:42
dim_carriers
dimension
6
1 MB
2026-09-01 05:42
rpt_delivery_sla
report table
8,766
1 MB
2026-09-01 05:42
metric_service
metric
1,461
view
2026-09-01 05:42

Read by

1 role in ops/query_logs.csv
operations_analyst
Operations
shipments against promises, by carrier
read from the warehouse and the SQL headers
DIMENSION · TRADING
dim_date
date_keyPK
calendar_date
year_month
day_name
+ 9 columns
DIMENSION · CUSTOMERS
dim_countries
country_codePK
name
region
currency
FACT
fact_shipments
shipment_idPK
date_keyFK
carrierFK
ship_countryFK
on_time
+ 3 columns
DIMENSION
dim_carriers
carrierPK
name
country
REPORT TABLE
rpt_delivery_sla
dayPK
carrierPK
shipments
on_time_pct
+ 3 columns
METRIC
metric_service
dayPK
shipments
on_time_pct
returns
+ 3 columns
date_key
ship_country
carrier
built from
built from

One row is

4 tables
table
one row is
key
joins on
fact_shipments
a shipment of an order
shipment_id
order_id, date_key, carrier, ship_country
dim_carriers
a carrier
carrier
rpt_delivery_sla
a day and a carrier
day, carrier
built from fact_shipments
metric_service
a day
day
built from fact_shipments, fact_returns and the tickets
tables4
size162 MB
queries · 2026-08338
last update2026-09-01 05:42
read byOperations
PL
Purchasing and Logistics
head of purchasing and logistics
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner

Returns

no data contract
one row per returned line with the reason and the refund, and the returns by month and reason
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

3 tables · gold_marts
table
kind
rows
size
last update
fact_returns
fact
402,118
14 MB
2026-09-01 05:42
dim_return_reasons
dimension
14
1 MB
2026-09-01 05:42
rpt_returns_by_reason
report table
672
1 MB
2026-09-01 05:42

Read by

2 roles in ops/query_logs.csv
operations_analyst
Operations
returns and their reasons
finance_analyst
Finance
refunds by month
read from the warehouse and the SQL headers
DIMENSION · TRADING
dim_date
date_keyPK
calendar_date
year_month
day_name
+ 9 columns
DIMENSION · PRODUCTS
dim_products
skuPK
product_name
brand
category
+ 8 columns
FACT
fact_returns
return_idPK
line_idFK
date_keyFK
reason_codeFK
skuFK
refund_eur
+ 2 columns
DIMENSION
dim_return_reasons
reason_codePK
reason
reason_group
FACT · TRADING
fact_order_lines
line_idPK
date_keyFK
customer_idFK
skuFK
is_cancelled
net_eur
+ 12 columns
REPORT TABLE
rpt_returns_by_reason
monthPK
reason_codePK
returns
refund_eur
+ 2 columns
date_key
sku
reason_code
built from
line_id

One row is

3 tables
table
one row is
key
joins on
fact_returns
a returned order line
return_id
line_id, date_key, reason_code, sku
dim_return_reasons
a return reason
reason_code
rpt_returns_by_reason
a month and a reason
month, reason_code
built from fact_returns
tables3
size16 MB
queries · 2026-08104
last update2026-09-01 05:42
read byOperationsFinance
CO
Customer Operations
head of customer operations
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Stock and purchasing

Stock and purchasing

no data contract
stock per SKU and day, purchase orders, the suppliers and their fill rate by month
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

4 tables · gold_marts
table
kind
rows
size
last update
fact_stock_daily
fact
13,402,118
210 MB
2026-09-01 05:42
fact_purchases
fact
6,870
1 MB
2026-09-01 05:42
dim_suppliers
dimension
8
1 MB
2026-09-01 05:42
rpt_supplier_fill_rate
report table
384
1 MB
2026-07-22 05:41

Read by

1 role in ops/query_logs.csv
operations_analyst
Operations
stock, purchase orders and the fill rate
read from the warehouse and the SQL headers
DIMENSION · TRADING
dim_date
date_keyPK
calendar_date
year_month
day_name
+ 9 columns
DIMENSION
dim_suppliers
supplier_idPK
name
country
lead_days
+ 1 column
FACT
fact_stock_daily
date_keyPK
skuPK
on_hand
days_of_cover
+ 1 column
DIMENSION · PRODUCTS
dim_products
skuPK
product_name
brand
category
+ 8 columns
FACT
fact_purchases
po_idPK
date_keyFK
supplier_idFK
skuFK
lead_days
+ 3 columns
REPORT TABLE · STALE
rpt_supplier_fill_rate
monthPK
supplier_idPK
fill_rate_pct
avg_lead_days
+ 2 columns
date_key
date_key
sku
sku
supplier_id
built from

One row is

4 tables
table
one row is
key
joins on
fact_stock_daily
a SKU on a day
date_key, sku
date_key, sku
fact_purchases
a purchase order of one product
po_id
date_key, supplier_id, sku
dim_suppliers
a supplier
supplier_id
rpt_supplier_fill_rate
a month and a supplier
month, supplier_id
built from fact_purchases; last rebuilt 2026-07-22
tables4
size213 MB
queries · 2026-0870
last update2026-09-01 05:42
read byOperations
PL
Purchasing and Logistics
head of purchasing and logistics
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Campaigns

Campaigns

no data contract
one row per approved campaign window, and the discount offers of the old promotions table
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

2 tables · gold_marts
table
kind
rows
size
last update
dim_campaigns
dimension
1,844
1 MB
2026-09-01 05:42
dim_promotions_old
dimension
20,362
3 MB
2026-08-14 10:12

Read by

1 role in ops/query_logs.csv
marketing_analyst
Marketing
campaign windows and their offers
read from the warehouse and the SQL headers
DIMENSION
dim_campaigns
campaign_idPK
name
starts_on
ends_on
+ 2 columns
DIMENSION · STALE
dim_promotions_old
offer_idPK
skuFK
campaign_idFK
discount_pct
+ 8 columns
FACT · TRADING
fact_orders
order_idPK
date_keyFK
customer_idFK
campaign_idFK
is_cancelled
net_eur
+ 4 columns
DIMENSION · PRODUCTS
dim_products
skuPK
product_name
brand
category
+ 8 columns
campaign_id
campaign_id
sku

One row is

2 tables
table
one row is
key
joins on
dim_campaigns
an approved campaign window
campaign_id
dim_promotions_old
a discount offer on one SKU
offer_id
sku, campaign_id; run manually on 2026-08-14
tables2
size4 MB
queries · 2026-0834
last update2026-09-01 05:42
read byMarketing
AM
Marketing
head of marketing
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Daily sales

Daily sales

deprecated
order lines read straight from bronze; replaced by the one big table on 2026-07-31
Overview
Guide
Data model
Metrics
Queries
Quality
Releases
Contract

Tables

1 table · gold_marts
table
kind
rows
size
last update
rpt_daily_sales_wide
report table
16,902,377
1.2 GB
2026-07-31 05:41

Read by

1 role in ops/query_logs.csv
monday_pack
the BI service
5 queries in 2026-08 against a table that holds no 2026-08
read from the warehouse and the SQL headers
BRONZE TABLE
commerce_orders
ord_id
ord_ts
cust_ref
status
+ 17 columns
REPORT TABLE · DEPRECATED
rpt_daily_sales_wide
sales_day
ord_id
net_ct
_corrupt_record
+ 33 columns
ONE BIG TABLE · TRADING
obt_order_lines
line_idPK
order_id
ordered_on
net_eur
+ 19 columns
BRONZE TABLE
commerce_order_lines
line_ref
ord_id
sku
net_ct
+ 9 columns
built from
built from
replaced by

One row is

1 table
table
one row is
key
joins on
rpt_daily_sales_wide
a bronze order line joined to its bronze order, as delivered
none
read from bronze; deprecated on 2026-07-31
tables1
size1.2 GB
queries · 2026-085
last update2026-07-31 05:41
read byFinance
FI
Finance
head of finance; Trading replaced it on 2026-07-31
DP
Data Platform
head of data platform, signs off a release
DE
Data engineering
the data engineer, owner
Data Products/Trading/obt_order_lines
Data
the table itself
obt_order_lines
Filter rows
#
line_id
ordered_on
category
ship_country
quantity
net_eur
1
SO468920-01
2026-08-31
Monitors
DE
2
205.87
2
SO468920-02
2026-08-31
Phones and Tablets
DE
3
680.55
3
SO468920-03
2026-08-31
Accessories
DE
1
16.63
4
SO468921-01
2026-08-31
Monitors
DE
1
182.77
5
SO468922-01
2026-08-31
Phones and Tablets
FR
1
149.99
6
SO468923-01
2026-08-31
Accessories
DE
1
36.13
7
SO468924-01
2026-08-31
Computers
IT
2
1115.95
8
SO468925-01
2026-08-31
Accessories
DE
2
41.66
9
SO468925-02
2026-08-31
Audio
DE
2
252.08
10
SO468925-03
2026-08-31
Accessories
DE
1
31.08
12,418,906 rows · showing 10
obt_order_lines
everything the platform knows about this table
release 1.1.0 · active
Metadata
Semantic
Lineage
Contact
one row per order line of an order that was not cancelled, with its day, customer and product beside it
rows
12,418,906
size
820 MB
format
duckdb
location
newvolt.duckdb/gold_marts
last update
2026-09-01 05:42
DE
the data engineer
owner
pipeline/gold/marts/obt_order_lines.sql
built by · every run that succeeds, 05:30 UTC
column
type
nulls
meaning
line_id
VARCHAR
not null
the order line number, like SO372035-01; the key
order_id
VARCHAR
not null
the order the line belongs to; several lines share one order
ordered_on
DATE
not null
the day the order was placed, the UTC day of the checkout
order_month
VARCHAR
not null
the month the order was placed, like 2026-08
order_year
BIGINT
not null
the year the order was placed
customer_id
VARCHAR
not null
the shop account that ordered, or unknown for a guest checkout
customer_type
VARCHAR
not null
Finance's customer type at placement: guest, new or returning
home_country
VARCHAR
can be null
the country of the customer's account, ISO 3166-1 alpha-2; not where the order was sent
signup_channel
VARCHAR
can be null
where the account was created: web or app
is_business
BOOLEAN
can be null
true when the account belongs to a business account
sku
VARCHAR
not null
the product on the line, one physical variant
product_name
VARCHAR
not null
the name of the product; it does not always say the colour
brand
VARCHAR
not null
the brand: Kaivo, Kova, Nodo, Ondia, Pavo or Visna
category
VARCHAR
not null
the category: Phones and Tablets, Computers, Monitors, Accessories or Audio
ship_country
VARCHAR
not null
the country the order ships to, ISO 3166-1 alpha-2; the market of the sale
channel
VARCHAR
not null
where the order was placed: web, app or marketplace
acquisition_source
VARCHAR
can be null
the last touch that brought the checkout; always marketplace on a marketplace order
campaign_id
VARCHAR
can be null
the campaign window the order fell in, if any; it does not prove an offer was used
quantity
INTEGER
not null
the ordered units on the line
additive
gross_eur
DOUBLE
not null
quantity times list price, before any discount, in euros without VAT
additive
discount_eur
DOUBLE
not null
the whole discount on the line, in euros without VAT
additive
net_eur
DOUBLE
not null
the line after the discount, in euros without VAT; net revenue, no shipping, no refunds
additive
standard_cost_eur
DOUBLE
can be null
quantity times the standard cost valid on the order day, in euros
additive
The 4 euro columns are DOUBLE in the warehouse and DECIMAL(18,2) in the contract, a known issue: round every total to the cent.

metric_trading

view · one definition per measuredraft for Finance
Finance's trading measures by month, ship country, channel, customer type and category; cancelled orders are left out

Measures

8 measures
measure
formula
meaning
gross_merchandise_eur
sum(gross_eur)
quantity times list price before discount, in euros without VAT; additive
discount_eur
sum(discount_eur)
the total line discount, in euros without VAT; additive
net_revenue_eur
sum(net_eur)
the line amounts after discount, in euros without VAT; excludes shipping and refunds; additive
orders
count(DISTINCT order_id)
distinct orders that were not cancelled; not additive
registered_customers
count(DISTINCT customer_id) FILTER (WHERE customer_id <> 'unknown')
distinct shop accounts with an order; guests are not counted; not additive
sold_units
sum(quantity)
the units sold; additive
average_order_value_eur
sum(net_eur) / nullif( count(DISTINCT order_id), 0)
net revenue divided by distinct orders; blank when there is no order
weighted_discount
sum(discount_eur) / nullif( sum(gross_eur), 0)
total line discount divided by gross merchandise, not the average of line percentages

Dimensions

5 dimensions
dimension
formula
meaning
order_month
dim_date.year_month
the month the order was placed, like 2026-08
ship_country
fact_order_lines.ship_country
the country the order ships to
channel
fact_order_lines.channel
where the order was placed: web, app or marketplace
customer_type
fact_order_lines.customer_type
Finance's customer type at placement: guest, new or returning
category
dim_products.category
the category of the product
source · commerce
order_lines.csv, the daily feed
bronze
bronze.commerce_order_lines
silver_clean
silver_clean.order_lines
silver_core
silver_core.order_lines
gold
gold_marts.fact_order_lines
gold · you are here
gold_marts.obt_order_lines
consumer · monday_pack
the Monday trading pack
consumer · finance_analyst
Finance
FI
Finance
head of finance · steward, owns the definitions of the measures
Finance team
signs the metric drafts
DE
the data engineer
owner · builds the table, answers for the data
data engineering team
a number that looks wrong goes here
DP
Data Platform
head of data platform · signs off a release
Data Platform team
scope and priorities