Cell 1 — SQL412 ms · 90 rows
-- net_revenue · owner: finance@empresa.do certified 2026-06-02
SELECT
date_trunc('day', o.placed_at) AS day,
sum(o.gross_amount - o.discount
- o.refund_amount - o.tax_amount) AS net_revenue
FROM fct_orders o
WHERE o.status IN ('paid','settled')
AND o.is_test = false
GROUP BY 1
-- 41 downstream dashboards depend on this metric
Out[1] — net_revenue by daylast 4 of 90 rows
JunJulAug
| Day | Orders | Gross | Refunds | net_revenue |
|---|---|---|---|---|
| 2026-08-21 | 1,286 | RD$1.31M | −RD$42.1k | RD$1,084,220 |
| 2026-08-22 | 1,342 | RD$1.36M | −RD$38.8k | RD$1,131,540 |
| 2026-08-23 | 1,187 | RD$1.22M | −RD$51.3k | RD$988,470 |
| 2026-08-24 | 1,405 | RD$1.41M | −RD$35.6k | RD$1,178,900 |
Cell 2 — SQL1.4 s · 7 cohorts
-- 90-day retention · monthly cohorts, months since first order
WITH cohorts AS (
SELECT customer_id, date_trunc('month', min(placed_at)) AS cohort
FROM fct_orders WHERE is_test = false GROUP BY 1)
SELECT c.cohort, datediff('month', c.cohort, o.placed_at) AS m,
count(DISTINCT o.customer_id) * 100.0 / max(c.size) AS pct_retained
FROM fct_orders o JOIN cohorts c USING (customer_id)
GROUP BY 1, 2 ORDER BY 1, 2
-- 49 cells · 7 cohorts × 7 months
OUT[2] — % RETAINED BY COHORT
M0
M1
M2
M3
M4
M5
M6
Feb
Mar
Abr
May
Jun
Jul
Ago
Pipeline health
| Model | Last run | Tests | Status |
|---|---|---|---|
| stg_orders | 12 min ago | 14 / 14 | Passing |
| fct_orders | 12 min ago | 22 / 22 | Passing |
| dim_customers | 12 min ago | 9 / 9 | Passing |
| fct_subscriptions | 48 min ago | 7 / 8 | 1 warning |
| mart_marketing_attrib | 6 h ago | 5 / 11 | Failing |
Models
Modelfct_orders
Ownerfinance@empresa.do
Certified2026-06-02
Rows4.2M
Refreshed12 min ago
Downstream41 dashboards
Tests22 / 22 passing