Skip to content

KPI list

This is the canonical reference for every KPI computed by P2Lab Stats. The same metrics appear in the in-module reports and in the KPI widgets above the order and customer list.

Each entry lists:

  • Definition — what the metric counts
  • Formula — how it’s computed
  • Where used — which report / widget surfaces it

All metrics support previous-period comparison (Δ %) calculated against an equal-length range ending immediately before the current range.

Available in the Order KPI widget and the Sales reports.

  • Definition — count of orders placed in the range.
  • FormulaCOUNT(*) over orders whose orderDateTime falls in the range and whose stateMachineState is in the active filter.
  • Where used — every sales report, order KPI widget.
  • Definition — total line-item quantity in the range.
  • FormulaSUM(lineItem.quantity) over orders in the range.
  • Where used — Sales summary, order KPI widget.
  • Definition — count of orders that reached the “completed” / “done” state in the range.
  • FormulaCOUNT(*) over orders with state machine history showing a transition to done within the range.
  • Where used — order KPI widget.
  • Definition — orders that reached done within the configured SLA window from the order date.
  • FormulaCOUNT(*) over orders where (doneAt - orderDateTime) <= sla_window.
  • Where used — order KPI widget.
  • Definition — total monetary value of orders in the range.
  • FormulaSUM(amountTotal) (or amountNet, configurable) over orders in the range.
  • Where used — every sales report, order KPI widget.
  • Definition — average order value.
  • Formularevenue / orders.
  • Where used — every sales report, order KPI widget.
  • Definition — count of orders that reached the cancelled state in the range.
  • FormulaCOUNT(*) over orders with a transition to cancelled in the range.
  • Where used — Sales → Cancelled, order KPI widget.
  • Definition — orders with a refund transaction in the range.
  • FormulaCOUNT(DISTINCT orderId) over refund transactions in the range.
  • Where used — order KPI widget.

Available in the Customer KPI widget and the Customer reports.

  • Definition — customers whose first order falls in the range.
  • FormulaCOUNT(DISTINCT customerId) where the customer’s earliest order is in the range.
  • Note — counts on first-order date, not registration date.
  • Where used — Customer overview, customer KPI widget.
  • Definition — customers who had at least one order before the range and at least one order in the range.
  • FormulaCOUNT(DISTINCT customerId) with (min_order_date < range_start) AND (any order in range).
  • Where used — Customer overview, customer KPI widget.
  • Definition — customers who placed at least one order in the range.
  • FormulaCOUNT(DISTINCT customerId) over orders in the range.
  • Where used — Customer overview, customer KPI widget, cohort matrix.
  • Definition — average number of orders each active customer placed in the range.
  • Formulaorders / active_customers.
  • Where used — Customer overview, customer KPI widget.
  • Definition — average revenue per active customer.
  • Formularevenue / active_customers.
  • Where used — Customer overview, customer KPI widget.
  • Definition — orders without a registered customer account.
  • FormulaCOUNT(*) over orders where orderCustomer.customerId IS NULL.
  • Where used — Customer overview, customer KPI widget.
  • Definition — share of previous-period customers who also ordered in the current period.
  • Formulacustomers_in_both_periods / customers_in_previous_period.
  • Where used — Customer overview, customer KPI widget.
  • Definition — share of guest orders that resulted in a registered customer account.
  • Formulaguest_orders_converted / total_guest_orders.
  • Where used — Customer overview, customer KPI widget.

Used across the Stock reports.

SUM(product.stock) across the catalogue (excluding deactivated products by default).

COUNT(*) WHERE stock > 0 and its complement.

SUM(stock × purchasePrice) — switchable to stock × price (selling) under the report’s view options.

COUNT(*) WHERE stock <= low_stock_threshold.

Per product: current_stock / (units_sold_in_range / days_in_range). Used as the basis for Overstock and Depletion risk.

Used in the Margins report.

SUM(revenue - cogs) over orders in the range, where cogs = SUM(lineItem.quantity × purchase_price_at_order_time).

total_margin / revenue × 100, weighted by revenue.

COUNT(*) WHERE product_margin_pct < threshold.

COUNT(*) WHERE current_period_margin_pct < previous_period_margin_pct.