fix: funnel for milliseconds difference

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-11-17 13:56:39 +01:00
parent da59622dce
commit dcc0d0df18

View File

@@ -125,6 +125,7 @@ export class FunnelService {
} }
const funnelWindowSeconds = funnelWindow * 3600; const funnelWindowSeconds = funnelWindow * 3600;
const funnelWindowMilliseconds = funnelWindowSeconds * 1000;
const group = this.getFunnelGroup(funnelGroup); const group = this.getFunnelGroup(funnelGroup);
const funnels = this.getFunnelConditions(events); const funnels = this.getFunnelConditions(events);
const profileFilters = this.getProfileFilters(events); const profileFilters = this.getProfileFilters(events);
@@ -140,7 +141,7 @@ export class FunnelService {
...breakdowns.map( ...breakdowns.map(
(b, index) => `${getSelectPropertyKey(b.name)} as b_${index}`, (b, index) => `${getSelectPropertyKey(b.name)} as b_${index}`,
), ),
`windowFunnel(${funnelWindowSeconds}, 'strict_increase')(toUnixTimestamp(created_at), ${funnels.join(', ')}) AS level`, `windowFunnel(${funnelWindowMilliseconds}, 'strict_increase')(toUInt64(toUnixTimestamp64Milli(created_at)), ${funnels.join(', ')}) AS level`,
]) ])
.from(TABLE_NAMES.events, false) .from(TABLE_NAMES.events, false)
.where('project_id', '=', projectId) .where('project_id', '=', projectId)