fix(dashboard): broken funnels on profile_id
This commit is contained in:
@@ -16,7 +16,7 @@ export class FunnelService {
|
||||
|
||||
private getFunnelGroup(group?: string) {
|
||||
return group === 'profile_id'
|
||||
? [`COALESCE(nullIf(s.profile_id, ''), e.profile_id)`, 'profile_id']
|
||||
? [`COALESCE(nullIf(s.profile_id, ''), profile_id)`, 'profile_id']
|
||||
: ['session_id', 'session_id'];
|
||||
}
|
||||
|
||||
@@ -155,12 +155,15 @@ export class FunnelService {
|
||||
: null;
|
||||
|
||||
// Base funnel query with CTEs
|
||||
const funnelQuery = clix(this.client).with('funnel', funnelCte);
|
||||
const funnelQuery = clix(this.client);
|
||||
|
||||
if (sessionsCte) {
|
||||
funnelCte.join('sessions s', 's.id = session_id');
|
||||
funnelQuery.with('sessions', sessionsCte);
|
||||
}
|
||||
|
||||
funnelQuery.with('funnel', funnelCte);
|
||||
|
||||
funnelQuery
|
||||
.select<{
|
||||
level: number;
|
||||
|
||||
Reference in New Issue
Block a user