Demo dbt



|
dbt + DuckDB Demo Interactivo
PIPELINE OK • 21/21 TESTS

50
Pedidos Totales
Ene – Oct 2023

€17,127.87
Revenue Neto
48 completados

€7,253.87
Beneficio Bruto
Margen medio 51.6%

10
Clientes
3 VIP • 6 High • 1 Medium

12
Productos
4 categorías

6
Modelos dbt
4 views + 2 tables

Revenue Mensual (2023)

Revenue por Categoría

Revenue por País

Distribución de Clientes por Valor




Haz clic en un nodo para ver detalles y dependencias

SEEDS STAGING INTERMEDIATE MARTS

seed raw_customers seed raw_products seed raw_orders

view stg_customers view stg_products view stg_orders

view int_orders_enriched

table fct_orders table dim_customers

Staging
stg_customersview
stg_productsview
stg_ordersview
Intermediate
int_orders_enrichedview
Marts
fct_orderstable
dim_customerstable

stg_customers.sql

models/staging/





SELECT order_id, order_date, customer_name, product_name, product_category, quantity, gross_revenue, net_revenue, gross_profit, margin_pct, status, channel FROM marts.fct_orders ORDER BY order_id LIMIT 15
order_id▲ order_date▲ customer_name▲ product_name▲ category▲ qty▲ gross_rev▲ net_rev▲ profit▲ margin%▲ status▲ channel▲

SELECT customer_id, full_name, country, segment, total_orders, completed_orders, lifetime_revenue, lifetime_profit, avg_order_value, value_tier FROM marts.dim_customers ORDER BY lifetime_revenue DESC
id▲ full_name▲ country▲ segment▲ orders▲ completed▲ lifetime_rev▲ lifetime_profit▲ avg_order▲ value_tier▲

SELECT strftime(order_month,’%Y-%m’) as month, count(*) as orders, sum(quantity) as units, round(sum(net_revenue),2) as revenue, round(sum(gross_profit),2) as profit, round(avg(margin_pct),1) as avg_margin FROM marts.fct_orders WHERE is_completed GROUP BY 1 ORDER BY 1
month▲ orders▲ units▲ revenue▲ profit▲ avg_margin%▲

SELECT product_category, count(*) as orders, round(sum(net_revenue),2) as revenue, round(sum(gross_profit),2) as profit, round(avg(margin_pct),1) as avg_margin FROM marts.fct_orders WHERE is_completed GROUP BY 1 ORDER BY revenue DESC
category▲ orders▲ revenue▲ profit▲ avg_margin%▲

SELECT customer_country, count(*) as orders, round(sum(net_revenue),2) as revenue, round(avg(margin_pct),1) as avg_margin FROM marts.fct_orders WHERE is_completed GROUP BY 1 ORDER BY revenue DESC
country▲ orders▲ revenue▲ avg_margin%▲

Proyecto dbt de demostración — dataprix.net

dbt-core 1.8.0 • dbt-duckdb 1.8.0 • DuckDB • Docker


Contenido elaborado con asistencia de inteligencia artificial — Equipo Editorial Dataprix. Verifica la información antes de tomar decisiones.

Cada semana, estas noticias y lo mejor de Dataprix en tu correo

Suscribirme al boletín