Celda 1 — SQL412 ms · 90 filas
-- 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 por díaúltimas 4 de 90 filas
JunJulAug
| Día | Órdenes | Bruto | Devoluciones | 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 |
Celda 2 — SQL1.4 s · 7 cohortes
-- 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] — % RETENIDO POR COHORTE
M0
M1
M2
M3
M4
M5
M6
Feb
Mar
Abr
May
Jun
Jul
Ago
Salud del pipeline
| Modelo | Última corrida | Pruebas | Estado |
|---|---|---|---|
| stg_orders | hace 12 min | 14 / 14 | Pasando |
| fct_orders | hace 12 min | 22 / 22 | Pasando |
| dim_customers | hace 12 min | 9 / 9 | Pasando |
| fct_subscriptions | hace 48 min | 7 / 8 | 1 aviso |
| mart_marketing_attrib | hace 6 h | 5 / 11 | Fallando |
Modelos
Modelofct_orders
Responsablefinance@empresa.do
Certificada2026-06-02
Filas4.2M
Actualizadohace 12 min
Dependientes41 tableros
Pruebas22 / 22 pasando