Skip to content

Commit

Permalink
reconsile with parent
Browse files Browse the repository at this point in the history
  • Loading branch information
fivetran-catfritz committed Jan 28, 2023
1 parent 78cbfd8 commit 5f62414
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ abandoned_checkouts_aggregated as (
abandoned_checkout_discount_code.source_relation,
sum(abandoned_checkout_discount_code.amount) as total_abandoned_checkout_discount_amount,
sum(coalesce(abandoned_checkout.total_line_items_price, 0)) as total_abandoned_checkout_line_items_price,
sum(coalesce(roll_up_shipping_line.price, 0)) as total_abandoned_checkout_shipping_price
sum(coalesce(roll_up_shipping_line.price, 0)) as total_abandoned_checkout_shipping_price,
count(distinct customer_id) as count_abandoned_checkout_customers,
count(distinct email) as count_abandoned_checkout_customer_emails,
count(distinct abandoned_checkout.checkout_id) as count_abandoned_checkouts

from abandoned_checkout_discount_code
left join abandoned_checkout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ orders_aggregated as (
max(orders.shipping_cost) as total_order_shipping_cost, -- summing would multiply the total by the # of discount codes applied to an order
max(orders.refund_subtotal + orders.refund_total_tax) as total_order_refund_amount, -- summing would multiply the total by the # of discount codes applied to an order
count(distinct customer_id) as count_distinct_customers,
count(distinct email) as count_distinct_customer_emails
count(distinct email) as count_distinct_customer_emails,
count(distinct order_discount_code.order_id) as count_orders

from order_discount_code
join orders
Expand Down

0 comments on commit 5f62414

Please sign in to comment.