Created
October 16, 2018 16:52
-
-
Save jonhilgart22/0a029163b0a0c8ccfa29a7b8d58848b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--waitlist | |
select | |
distinct | |
us.name, | |
us.email, | |
c.code as pricing_plan, | |
c.amount, | |
u.created_at::date as entered_credit_card_at | |
from user_events u | |
join coupons c | |
on c.id = json_extract_path_text(properties, 'coupon_id') | |
join analytics.acquisition_credit_card_source_tracking a | |
on a.user_id = u.user_id | |
and a.subscription_id is null | |
join users us | |
on us.id = u.user_id | |
where | |
event_name in ('Payment Form Completed', 'Requested Access') | |
and u.created_at >= getdate() - '30 days'::interval | |
order by 5 desc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment