{% extends "base.html" %} {% block title %}Factcat — Retention{% endblock %} {% block extra_head %} {% endblock %} {% block extra_css %} .retention-page { flex: 1; min-height: 0; overflow-y: auto; } .retention-form { max-width: 72rem; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; } .retention-form .summary { font-size: 0.8rem; color: var(--fc-slate); margin: 0 0 0.9rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; } .retention-form .summary .linkish { margin: 0; } .summary[hidden], .source[hidden] { display: none !important; } #refresh-events { margin-left: auto; } #refresh-events[hidden] { display: none !important; } .catalog-status { font-weight: 400; color: var(--fc-slate); font-size: 0.7rem; margin: 0 0 0.5rem; } .catalog-status[hidden] { display: none !important; } code.fc-sql { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.92em; background: var(--fc-paper); padding: 0 0.2rem; border-radius: 0.2rem; } .source { border: 1px solid var(--fc-line); border-radius: 0.5rem; background: var(--fc-snow); padding: 0.55rem 0.7rem 0.6rem; margin: 0 0 0.8rem; } .source-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1rem; font-size: 0.8rem; } .source-head label { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0; font-weight: 400; font-size: 0.8rem; } .source-head input[type="radio"] { width: auto; margin: 0; } .source-head .linkish { margin-left: auto; } .source-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; margin-top: 0.45rem; } .source-grid .src-field { min-width: 0; } .source-grid label { margin: 0 0 0.2rem; font-size: 0.72rem; } .source-grid select, .source-grid input { width: 100%; margin: 0; } .src-field[hidden], #src-tz-wrap[hidden] { display: none !important; } #src-tz-wrap { margin-top: 0.45rem; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; } #src-tz-wrap label { margin: 0; font-size: 0.75rem; } #src-tz-wrap select { width: auto; margin: 0; } .source .hint { margin: 0.4rem 0 0; } .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); gap: 0.7rem; margin: 0 0 0.4rem; } .card { border: 1px solid var(--fc-line); background: var(--fc-snow); border-radius: 0.5rem; padding: 0.45rem 0.6rem; min-width: 0; } .band-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fc-ink-soft); margin: 0 0 0.3rem; } .card-row { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; } .card-n { width: 1.3rem; height: 1.3rem; border-radius: 50%; flex: none; background: var(--fc-ink); color: var(--fc-snow); font-size: 0.7rem; display: grid; place-items: center; } .card .card-pick { width: auto; min-width: 9rem; max-width: 18rem; margin: 0; border-radius: 0.4rem; font-size: 0.82rem; } .card .card-sql { flex: 1 1 14rem; margin: 0; border-radius: 0.35rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.78rem; } .card-pick[hidden], .card-sql[hidden], .step-chips[hidden], .card .add-filter[hidden], .card .card-mode[hidden] { display: none !important; } .step-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; min-width: 0; max-width: 100%; } {% include "_filter_chips.css" %} .card-actions { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; } .card-actions .linkish { margin: 0; } .card .hint { margin: 0.35rem 0 0; font-size: 0.72rem; line-height: 1.45; } #entry-time { width: auto; min-width: 0; margin: 0 0.15rem; padding: 0.1rem 0.3rem; font-size: 0.72rem; } /* Labels share the top line; controls without a label sit on the control line. */ .retention-toolbar { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0.9rem 0 0.25rem; } .toolbar-field label { margin: 0 0 0.2rem; } .toolbar-field select { width: auto; min-width: 7rem; } .toolbar-cluster { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; } .toolbar-cluster[hidden] { display: none !important; } .toolbar-cluster label { display: inline; margin: 0; font-weight: 400; font-size: 0.8rem; } .toolbar-cluster input[type="number"] { width: 4.5rem; } .toolbar-cluster input[type="date"] { width: auto; } .toolbar-field .toolbar-cluster input[type="number"] { width: 4rem; margin: 0; } .seg { display: inline-flex; border: 1px solid var(--fc-line); border-radius: 0.4rem; overflow: hidden; } .seg button { margin: 0; padding: 0.3rem 0.65rem; border: 0; border-radius: 0; background: var(--fc-snow); color: var(--fc-ink); font-size: 0.78rem; font-weight: 400; cursor: pointer; } .seg button + button { border-left: 1px solid var(--fc-line); } .seg button[aria-pressed="true"] { background: var(--fc-ink); color: var(--fc-snow); font-weight: 600; } #run-row { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0 auto; flex-wrap: wrap; } #run-row button { margin: 0; } #run-estimate { font-size: 0.8rem; color: var(--fc-slate); } #cap-override { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; } #cap-override[hidden] { display: none !important; } {% include "_estimate_chip.css" %} .tabs { display: flex; gap: 1rem; border-bottom: 1px solid var(--fc-line); margin: 0.75rem 0 0.6rem; } .tabs button { margin: 0; padding: 0.3rem 0 0.35rem; background: none; color: var(--fc-ink-soft); border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 0.8rem; cursor: pointer; } .tabs button[aria-selected="true"] { color: var(--fc-ink); font-weight: 600; border-bottom-color: var(--fc-ink); } .tab-panel[hidden] { display: none !important; } {% include "_chart_empty.css" %} #chart-empty { min-height: 22rem; } #empty-copy { margin: 0; } #error { margin: 0.6rem 0 0; } .results[hidden] { display: none !important; } .curve-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.72rem; color: var(--fc-ink-soft); margin: 0 0 0.3rem; } .curve-legend i { display: inline-block; width: 1rem; height: 2px; vertical-align: middle; margin-right: 0.3rem; } .curve-legend [hidden] { display: none !important; } .retention-toolbar > .toolbar-cluster, .retention-toolbar > #run-row { align-self: flex-end; } /* The curve and the grid scroll together, so a point stays over its column. */ .hm-wrap { position: relative; overflow-x: auto; } .hm-wrap > .curve-canvas, table.hm { min-width: calc(12.1rem + var(--hm-periods, 8) * 3.2rem); } .curve-canvas { position: relative; height: 12rem; } table.hm { border-collapse: separate; border-spacing: 2px; font-size: 0.74rem; width: 100%; table-layout: fixed; margin: 0; } table.hm td, table.hm th { border: 0; } table.hm th { font-weight: 600; color: var(--fc-slate); font-size: 0.68rem; text-align: center; padding: 0.15rem 0; } table.hm th.l, table.hm td.l { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 0.2rem; } table.hm th.size, table.hm td.size { text-align: right; padding-right: 0.5rem; } table.hm td { text-align: center; padding: 0.3rem 0; border-radius: 3px; font-variant-numeric: tabular-nums; color: var(--fc-ink); } table.hm td.size { color: var(--fc-ink-soft); } table.hm tr.avg td { font-weight: 600; } table.hm tr.on td.l { font-weight: 600; } table.hm td.deep { color: var(--fc-snow); } table.hm td.prog { background: repeating-linear-gradient(135deg, var(--fc-ochre-wash), var(--fc-ochre-wash) 4px, var(--fc-snow) 4px, var(--fc-snow) 8px); color: var(--fc-ink-soft); outline: 1px dashed var(--fc-ochre); outline-offset: -1px; } #hm-tip { position: absolute; z-index: 3; pointer-events: none; background: var(--fc-ink); color: var(--fc-paper); font-size: 0.7rem; line-height: 1.45; padding: 0.35rem 0.55rem; border-radius: 0.35rem; max-width: 22rem; } #hm-tip[hidden] { display: none !important; } #hm-tip .prog-note { color: var(--fc-ochre); } .retention-caption { font-size: 0.8rem; color: var(--fc-ink-soft); margin: 0.6rem 0 0; line-height: 1.45; } .retention-caption[hidden] { display: none !important; } #result-table { width: 100%; margin-top: 0; } #result-table th { font-size: 0.72rem; color: var(--fc-slate); } #result-table .r { text-align: right; padding-right: 0.5rem; } .empty { color: var(--fc-slate); font-size: 0.85rem; margin: 0; } .empty.fail { color: var(--fc-alert); white-space: pre-wrap; } #sql { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.78rem; white-space: pre-wrap; } #sql.empty { color: var(--fc-slate); } {% endblock %} {% block body %}
{% set fc_entities = ((config.entity_label_plural or "Entities") if config.entity_label else "Entities") %}{% set fc_entities = fc_entities[:1]|upper ~ fc_entities[1:] %} {% set src = config.retention_source or {} %} {% set other = (src.mode == "table") %}

Retention

{% if not mapping_ready %}

Map a table on Setup before Retention can run.

{% endif %}

Setup's table: {{ config.table }} · {{ config.entity_label or "Entity" }} ({{ config.entity }}) · {{ config.event_time }}

{% include "_mapping_fields.html" %}
{% for step in table_steps.parts %}
{% endfor %}

Saved with this screen only; Events, Funnel and Setup keep their table. The event-name list belongs to Setup's table, so both cards below are SQL conditions here.

Entered when

Entry time:·

Counts as retained when

{% set range_label = "Cohorts entered" %}{% include "_report_range.html" %}
0 to

{% if mapping_ready %}Say what counts as retained.{% else %}Map a table on Setup before Retention can run.{% endif %}

{% endblock %}