Ratio
Custom stats: ratio, percentage, and advanced formula stats built from report KPIs, shown as report columns.
📄️ Add a Custom Stat
Creates a ratio, percentage, or advanced formula custom stat, which reports then offer as a column. `ratio` and `percentage` stats divide `numerator` by `denominator`; `formula` stats evaluate `formula` with the `$` variables mapped in `scopes`. Each input is a numeric report KPI or another custom stat's `ratioId`: call /report/column and use the `value` of a column whose `type` is `number`, such as `contact.pitches` or `meetingAttendance.count`. A formula must parse, and a stat cannot reference itself directly or through other stats. `scopeId` is the company, team, or user the stat belongs to; omit it to use the caller's company. Requires the `ratio:save` permission for that scope.
📄️ Get a Custom Stat
Returns one ratio or advanced formula custom stat's complete stored definition, including its inputs, formula, scope and workflow filters, formatting, and modification history. Requires the `ratio:list` permission for the stat's scope.
📄️ List Custom Stats
Lists ratio and advanced formula custom stats with their complete stored definitions and modification history. `scopeId` matches only stats stored at exactly that company, team, or user scope; it does not include inherited scopes. Omit it to use the caller's company. `workflowId` includes global stats without a workflow and stats assigned to exactly that workflow. Omit it to include all workflows. Requires the `ratio:list` permission for the requested scope.
📄️ Remove a Custom Stat
Deletes a custom stat, so reports no longer offer it as a column. Requires the `ratio:save` permission for the stat's stored scope.
📄️ Update a Custom Stat
Replaces an existing custom stat with the definition sent, so send every field you want to keep: start from /ratio/get. `ratio` and `percentage` stats divide `numerator` by `denominator`; `formula` stats evaluate `formula` with the `$` variables mapped in `scopes`. Each input is a numeric report KPI or another custom stat's `ratioId`: call /report/column and use the `value` of a column whose `type` is `number`, such as `contact.pitches` or `meetingAttendance.count`. A formula must parse, and a stat cannot reference itself directly or through other stats. `ratioId` and `scopeId` are required; a different `scopeId` moves the stat to that company, team, or user. Requires the `ratio:save` permission for both the stat's stored scope and the requested `scopeId`.