MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / buildInlineCohortJoin

Function buildInlineCohortJoin

packages/db/src/services/chart.service.ts:156–164  ·  view source on GitHub ↗
(
  cohortId: string,
  projectId: string,
  tableAlias: string,
)

Source from the content-addressed store, hash-verified

154}
155
156export function buildInlineCohortJoin(
157 cohortId: string,
158 projectId: string,
159 tableAlias: string,
160): string {
161 const cohortAlias = getCohortAlias(cohortId);
162 const cohortQuery = buildCohortMembershipQuery(cohortId, projectId);
163 return `LEFT ANY JOIN (${cohortQuery}) AS ${cohortAlias} ON ${cohortAlias}.profile_id = ${tableAlias}.profile_id`;
164}
165
166export function extractCohortId(breakdownName: string): string | null {
167 if (breakdownName.startsWith('cohort:')) {

Callers 3

getFunnelMethod · 0.90
getConversionMethod · 0.90
getChartSqlFunction · 0.85

Calls 2

getCohortAliasFunction · 0.85

Tested by

no test coverage detected