From edb7836e0c7b6c295c332e9c2ff7e6078f6a68fe Mon Sep 17 00:00:00 2001 From: Jordan Stein Date: Mon, 6 May 2024 21:53:18 -0700 Subject: [PATCH] add models --- models/marts/customer360/agg_daily_revenue_by_store.sql | 5 +++++ models/marts/customer360/agg_weekly_orders.sql | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 models/marts/customer360/agg_daily_revenue_by_store.sql create mode 100644 models/marts/customer360/agg_weekly_orders.sql diff --git a/models/marts/customer360/agg_daily_revenue_by_store.sql b/models/marts/customer360/agg_daily_revenue_by_store.sql new file mode 100644 index 0000000..bed8dbb --- /dev/null +++ b/models/marts/customer360/agg_daily_revenue_by_store.sql @@ -0,0 +1,5 @@ +select + sum(distinct product_price) as sum_product_price, + date_trunc('day',ordered_at) as orderd_at__day +from {{ref('order_items')}} +group by 2 \ No newline at end of file diff --git a/models/marts/customer360/agg_weekly_orders.sql b/models/marts/customer360/agg_weekly_orders.sql new file mode 100644 index 0000000..a397ffe --- /dev/null +++ b/models/marts/customer360/agg_weekly_orders.sql @@ -0,0 +1,5 @@ +select + count(distinct order_id) as count_orders, + date_trunc('week',ordered_at) as orderd_at__week +from {{ref('orders')}} +group by 2 \ No newline at end of file