an-lisis-de-cohortes
Cohort retention analysis — how groups of users or customers behave over time after an initial event
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Cohort retention analysis — how groups of users or customers behave over time after an initial event
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Sequence cleaning steps in a chain — trim/case/replace, null handling, deduplication, and type casting — in the right order. Use when raw ingested data needs cleaning before joins or aggregation.
Place Assert and Schema Validation nodes as gates that halt a chain when data is wrong, so bad data never reaches the output. Use when the pipeline must guarantee correctness before exporting or loading downstream.
Choose the right sink format, compression, and destination for a chain's output, and decide between exporting a file vs creating a table. Use at the end of a pipeline when deciding how to persist results.
Best practices for loading files into a chain — single file, folder globs, type detection, and union of many files. Use when the pipeline starts from CSV/Parquet/JSON/Excel files or a folder of files.
Decide between Merge (stack rows / UNION) and Join (match on a key) when a chain has multiple inputs, and set keys and join type correctly. Use when a pipeline combines two or more upstream tables.
Descompone un objetivo de procesamiento en un flujo de nodos Chains (source → transform → sink). Use when the user wants to build a data pipeline / chain, or describes an end-to-end "load X, clean it, summarize, export" goal.
| name | Análisis de Cohortes |
| description | Cohort retention analysis — how groups of users or customers behave over time after an initial event |
| keywords | cohort, retention, churn, lifetime, ltv, funnel, conversion, cohorte, retención, retencion, vuelven, retornan, regresan, abandono, grupos, segmento |
| next | data-storytelling |
Activa cuando el análisis requiere comparar grupos definidos por un evento de inicio (primera compra, registro, etc.) y rastrear su comportamiento a lo largo del tiempo.
El SQL de abajo es una plantilla canónica deliberada — el patrón de cohortes es frágil, así que síguela de cerca. Lo que sí es decisión de juicio es qué define la cohorte (paso 1): el evento de inicio, la granularidad y la métrica de éxito cambian todo el análisis. Si es ambiguo, pregunta antes de asumir.
WITH cohortes AS (
SELECT user_id,
DATE_TRUNC('month', MIN(fecha_evento)) AS mes_cohorte
FROM eventos
GROUP BY user_id
),
actividad AS (
SELECT e.user_id,
c.mes_cohorte,
DATE_TRUNC('month', e.fecha_evento) AS mes_actividad,
DATEDIFF('month', c.mes_cohorte, DATE_TRUNC('month', e.fecha_evento)) AS mes_numero
FROM eventos e
JOIN cohortes c USING (user_id)
)
SELECT mes_cohorte, mes_numero,
COUNT(DISTINCT user_id) AS usuarios_activos
FROM actividad
GROUP BY mes_cohorte, mes_numero
ORDER BY mes_cohorte, mes_numero
display_chart tipo heatmap (mes_cohorte en Y, mes_numero en X, tasa de retención como valor)final_answer con: tasa de retención promedio por período, cohorte con mejor/peor desempeño, tendencia de mejora o deterioroDATE_TRUNC('month', ...) a DATE_TRUNC('week', ...)