This page provides summary of the Formula Expressions used in the Unprofitable Account Agent (Reference).
Average Margin Percentage
Definition
The customer’s margin rate computed from transaction‑level data and aggregated per customer (conceptually margin divided by revenue).
Formula
SUM(GrossMargin)/ SUM(InvoicePrice)
Revenue Rank
Definition
The customer’s position when customers are sorted by revenue contribution (e.g., highest to lowest), used to identify long tail tiers.
Formula
PERCENT_RANK(SUM(InvoicePrice))
Margin Variance
Definition
The difference between an account’s margin rate and the relevant benchmark (e.g., segment or portfolio average), quantifying the degree of underperformance.
Formula
s2.AvgMarginPct - s1.AvgMarginPct
Quarter Margin Uplift
Definition
The monetary margin that could be recovered in the current quarter if the previous quarter’s margin rate were restored, applied to current-quarter revenue. This is a period-over-period uplift measure commonly used for quarter-over-quarter analyses.
Formula
((s1.Revenue* (s1.AvgMarginPct + s2.AvgMarginPct)/2) - s1.Profit)/4
Annual Revenue
Definition
The total invoiced sales value over a 12‑month period, computed as the sum of transaction invoice price within the selected annual window.
Formula
s1.Revenue
Margin Lift Potential Percetange
Definition
The potential profit uplift (percentage) per customer if their margin rate were raised to the relevant benchmark.
Formula
(s1.Revenue* (s1.AvgMarginPct + s2.AvgMarginPct)/2) / IFNULL(s1.Profit,0) - 1
Quarter Revenue Uplift
Definition
The hypothetical additional revenue in the current quarter if the realized price level matched a chosen benchmark (e.g., previous quarter’s level or a reference price), applied to current-quarter activity.
Formula
((s1.Revenue* (s1.AvgMarginPct + s2.AvgMarginPct)/2) - s1.Profit)/4
Current Margin Percentage
Definition
The weighted gross margin percentage for the current period, computed as total margin divided by total revenue (invoice price).
Formula
s1.AvgMarginPct
Suggested Margin Percentage
Definition
The recommended interim margin rate set at the midpoint between the current margin rate and the benchmark/target margin rate (e.g., segment average).
Formula
(s1.Revenue* (s1.AvgMarginPct + s2.AvgMarginPct)/2)/NULLIF(s1.Revenue,0)
Segment Average Margin Percentage
Definition
The weighted average gross margin rate for a given segment over the selected period, computed as total margin divided by total revenue across all entities in that segment. This is used as a benchmark in variance and uplift analyses.
Formula
s2.AvgMarginPct