KPIs by Cohort @php $fmtDuration = function ($seconds) { $hours = $seconds / 3600; if ($hours < 1) return number_format($seconds / 60, 0) . 'm'; if ($hours < 24) return number_format($hours, 1) . 'h'; return number_format($hours / 24, 1) . 'd'; }; $fmtCell = function (array $row) use ($fmtDuration) { $value = $row['value']; if ($value === null) { return ['—', 'text-muted']; } return match ($row['type']) { 'pct' => [number_format($value, 0) . '%', 'text-dark'], 'days' => [number_format($value, 0) . 'd', 'text-dark'], 'ratio' => [number_format($value, 1), 'text-dark'], 'duration' => [$fmtDuration($value), 'text-dark'], 'current' => [number_format($value), 'text-dark fw-semibold'], default => $value > 0 ? [number_format($value), 'text-dark'] : ['—', 'text-muted'], }; }; @endphp {{-- How this differs from the productivity report --}}
How this differs from KPIs by Productivity
  • KPIs by Productivity counts each metric by when the event happened, across the last 12 days / weeks / months. A single column mixes clients from many intakes.
  • This report instead fixes the group of clients created in your chosen date range (the “cohort”, e.g. one campaign week) and shows how far that same group has progressed to date. Use it to compare how individual intakes are performing.
  • Milestone rows (Contracts Signed, Sent To Redress, Closed, …) are cumulative — cohort members who have ever reached that stage — and rates are the cohort’s cumulative conversion, not a per-period rate.
  • Rows marked are live counts of where the cohort sits right now. They replace KPIs by Productivity’s 5pm-snapshot “stock” rows, which can’t be tied to a creation cohort.
{{-- Preset view, range picker and filter --}}
@if ($preset !== 'custom')
@endif
Cohort: clients created {{ $fromLabel }} to {{ $toLabel }} ({{ number_format($days) }} {{ Str::plural('day', $days) }})
{{-- Table --}}
@foreach ($rows as $row) @php [$text, $cls] = $fmtCell($row); @endphp @endforeach
Metric Cohort How it’s calculated
{{ $row['label'] }} @if ($row['sub']) {{ $row['sub'] }} @endif @if ($row['type'] === 'current') @endif {{ $text }} {{ $row['note'] }}

Rows marked with the green status icon are live and change as the cohort moves through the pipeline; every other row is cumulative to date.