Skip to content

Metric glossary

This page collects the cross-cutting analytical concepts used across multiple P2Lab Stats reports. For specific KPI metrics, see KPI list.

The dates picked in the date range picker. Either a preset (last 7 / 14 / 30 days, etc.) or a custom range from the dual-month calendar.

A range of equal length ending immediately before the current range starts. Used as the baseline for Δ % comparison everywhere in the plugin.

(current - previous) / previous × 100. Shown next to KPI values, in some table columns, and on chart tooltips. When the previous value is 0, the UI displays .

A toggle that excludes today from both the current and previous range. Useful because today is partial — including it makes Δ % look artificially low until the day completes.

revenue / orders. The arithmetic mean of order totals in the range.

Default: SUM(orders.amountTotal). Can be switched to net (excluding tax / shipping) under report options. Multi-currency orders are normalised to the shop default currency at the order date’s exchange rate.

SUM(lineItem.quantity × purchase_price_at_order_time). Uses the historical purchase price captured in the product snapshot if available, otherwise the current purchase price.

revenue - cogs. Displayed in currency.

margin / revenue × 100. Displayed as a percentage.

A customer with at least one order in the range.

A customer whose first-ever order falls in the range. Anchored on first-order date, not registration date.

A customer with an order before the range start and an order in the range.

customers_in_both_periods / customers_in_previous_period. Range-length-sensitive — comparing 7-day periods gives a different number than comparing 30-day periods.

A group of customers identified by their first-order month. The cohort matrix tracks how many of them return in M+1, M+2, … months.

The customer base ranked on Recency / Frequency / Monetary, split into 5 equal-size buckets. Score 5 = top quintile (best); score 1 = bottom quintile (worst).

Days since the customer’s last order in the range. Smaller is better.

Number of orders in the range. Bigger is better.

Total spend in the range. Bigger is better.

See RFM segments for how (R, F, M) triples map to named segments.

Share of orders that contain both products in a pair. count(orders_with_both) / count(all_orders_in_range).

Given that an order contains product A, the probability it also contains B. count(orders_with_both) / count(orders_with_A).

How much more likely the pair is than chance. confidence / support(B). Lift > 1 = positive association; lift = 1 = independent; lift < 1 = negative association.

current_stock / (units_sold_in_range / days_in_range). How many days the current stock would last at the recent sales velocity.

units_sold_in_range / days_in_range. Average daily units sold.

A flag set when days_of_supply < threshold (configurable). Used to surface products that will run out before they can be restocked.

Products with zero sales in the range and stock > 0. Flags capital tied up in non-moving inventory.

Products with days_of_supply > overstock_threshold (configurable). Flags excess inventory relative to demand.

A row in the p2lab_stats_product_snapshot table capturing a product’s price and stock at a point in time. Captured daily, idempotent per day, retained for the configured period.

Difference between the purchase price in two snapshots. Used by the Margins → Cost pressure view to surface products with rising costs.