implement filtering and cohorts to all relevant queries

This commit is contained in:
Francis Cao 2025-08-19 15:26:41 -07:00
parent 789b8b36d8
commit 2f1f704728
34 changed files with 311 additions and 167 deletions

View file

@ -76,12 +76,11 @@ async function relationalQuery(
select ${column} x,
count(distinct website_event.session_id) as y
from website_event
${joinSessionQuery}
${cohortQuery}
${joinSessionQuery}
${entryExitQuery}
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at between {{startDate}} and {{endDate}}
and event_type = {{eventType}}
${excludeDomain}
${filterQuery}
group by 1

View file

@ -73,12 +73,11 @@ async function relationalQuery(
select ${column} x,
count(distinct website_event.session_id) as y
from website_event
${joinSessionQuery}
${cohortQuery}
${joinSessionQuery}
${entryExitQuery}
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at between {{startDate}} and {{endDate}}
and event_type = {{eventType}}
${excludeDomain}
${filterQuery}
group by 1

View file

@ -26,11 +26,10 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
${getDateSQL('website_event.created_at', unit, timezone)} x,
count(*) y
from website_event
${joinSessionQuery}
${cohortQuery}
${cohortQuery}
${joinSessionQuery}
where website_event.website_id = {{websiteId::uuid}}
and website_event.created_at between {{startDate}} and {{endDate}}
and event_type = {{eventType}}
${filterQuery}
group by 1
order by 1