Skip to content

Commit 6a39f5e

Browse files
committed
Add promotion information
Signed-off-by: popcorny <[email protected]>
1 parent 8d75fcf commit 6a39f5e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

models/customers.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ customer_payments as (
3434

3535
select
3636
orders.customer_id,
37-
sum(amount)::bigint as total_amount
37+
sum(amount)::bigint as total_amount,
38+
bool_or(is_promotion) as has_promoted_orders
3839

3940
from payments
4041

models/staging/stg_payments.sql

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ renamed as (
1616
payment_method,
1717

1818
-- `amount` is currently stored in cents, so we convert it to dollars
19-
amount / 100 as amount
19+
amount / 100 as amount,
20+
payment_method == 'coupon' as is_promotion
2021

2122
from source
2223

0 commit comments

Comments
 (0)