This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
forked from singer-io/tap-hubspot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ea5920c
commit ee2fab3
Showing
9 changed files
with
97 additions
and
98 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
with chats_all_time as ( | ||
select * from {{ ref( 'chats_all_time' ) }} | ||
) | ||
with | ||
chats_all_time as ( | ||
select * from {{ ref('chats_all_time') }} | ||
) | ||
|
||
, users as ( | ||
select * from {{ ref( 'user_contract' ) }} | ||
, user_contract as ( | ||
select * from {{ ref('user_contract') }} | ||
) | ||
|
||
select users.organization_name | ||
, date_trunc('month', chats_all_time.created_at_day) as date_month | ||
, count(chats_all_time.user_id) as count_dau | ||
select user_contract.organization_id | ||
, user_contract.organization_name | ||
, date_trunc('month', chats_all_time.created_at_day) as date_month | ||
, count(chats_all_time.user_id) as count_dau | ||
from chats_all_time | ||
inner join users | ||
on chats_all_time.user_id = users.user_id | ||
and chats_all_time.created_at_day <@ | ||
tsrange(timezone('America/Montreal', lower(users.during)), | ||
timezone('America/Montreal', upper(users.during))) | ||
group by 1,2 | ||
inner join user_contract | ||
on chats_all_time.user_id = user_contract.user_id | ||
and chats_all_time.created_at_day <@ user_contract.during_est | ||
group by 1,2,3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
with chats_all_time as ( | ||
select * from {{ ref( 'chats_all_time' ) }} | ||
) | ||
with | ||
chats_all_time as ( | ||
select * from {{ ref('chats_all_time') }} | ||
) | ||
|
||
, users as ( | ||
select * from {{ ref( 'user_contract' ) }} | ||
, user_contract as ( | ||
select * from {{ ref('scribe_user_contract_detailed') }} | ||
) | ||
|
||
select users.organization_name | ||
, date_trunc('month', chats_all_time.created_at_day) as date_month | ||
, count(distinct users.user_id) as count_mau | ||
select user_contract.organization_id | ||
, user_contract.organization_name | ||
, date_trunc('month', chats_all_time.created_at_day) as date_month | ||
, count(distinct user_contract.user_id) as count_mau | ||
from chats_all_time | ||
inner join users using (user_id) | ||
inner join user_contract | ||
on chats_all_time.user_id = user_contract.user_id | ||
and chats_all_time.created_at_day <@ user_contract.during_est | ||
-- Before this date not all users had organizations | ||
where created_at_day > '2017-10-01' | ||
group by 1,2 | ||
where chats_all_time.created_at_day > '2017-10-01' | ||
group by 1,2,3 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
with videos as ( | ||
select * from {{ ref( 'videos_by_ep_daily' ) }} | ||
) | ||
with | ||
videos as ( | ||
select * from {{ ref('videos_by_ep_daily') }} | ||
) | ||
|
||
, users as ( | ||
select * from {{ ref( 'user_contract' ) }} | ||
) | ||
, user_contract as ( | ||
select * from {{ ref('user_contract') }} | ||
) | ||
|
||
select patients.organization_name | ||
, date_trunc('month', videos.date_day_est) as date_month | ||
, count(distinct | ||
concat(patients.user_id, | ||
select user_contract.organization_id | ||
, user_contract.organization_name | ||
, date_trunc('month', videos.date_day_est) as date_month | ||
, count(distinct | ||
concat(user_contract.user_id, | ||
date_trunc('day', | ||
videos.date_day_est) | ||
) | ||
) as count_videos | ||
from videos | ||
inner join users as patients | ||
on videos.patient_id = patients.user_id | ||
and tsrange(timezone('America/Montreal', lower(patients.during)), | ||
timezone('America/Montreal', upper(patients.during))) | ||
@> videos.date_day_est | ||
inner join user_contract | ||
on videos.patient_id = user_contract.user_id | ||
and videos.date_day_est <@ user_contract.during_est | ||
where videos.includes_video_gp | ||
group by 1,2 | ||
group by 1,2,3 |
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