Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix(api): broken overview when filter path

Carl-Gerhard Lindesvärd92210c1b3f9e
diff --git a/packages/db/src/services/overview.service.ts b/packages/db/src/services/overview.service.ts
index 5a89a608b..11f101c4b 100644
--- a/packages/db/src/services/overview.service.ts
+++ b/packages/db/src/services/overview.service.ts
@@ -232,7 +232,7 @@ export class OverviewService {
overall_total_sessions: number;
overall_bounce_rate: number;
}>([
- `${clix.toInterval('e.created_at', interval)} AS date`,
+ `${clix.toStartOf('e.created_at', interval)} AS date`,
'ds.bounce_rate as bounce_rate',
'uniq(e.profile_id) AS unique_visitors',
'uniq(e.session_id) AS total_sessions',
@@ -247,7 +247,7 @@ export class OverviewService {
.from(`${TABLE_NAMES.events} AS e`)
.leftJoin(
'daily_stats AS ds',
- `${clix.toInterval('e.created_at', interval)} = ds.date`,
+ `${clix.toStartOf('e.created_at', interval)} = ds.date`,
)
.where('e.project_id', '=', projectId)
.where('e.name', '=', 'screen_view')