This page provides summary of the Formula Expressions used in the Margin Shortfall Agent (Refence).
Revenue Rank
Definition
The customer’s position when customers are sorted by revenue contribution within the selected group (e.g., product group), used to identify high-revenue customers.
Formula
PERCENT_RANK(SUM(InvoicePrice))
Margin Rank
Definition
The customer’s position when customers are sorted by margin rate or margin contribution within the selected group, enabling comparison to revenue rank.
Formula
PERCENT_RANK(SUM(Margin))
Margin Variance
Definition
The difference between a customer’s average margin percentage and the relevant benchmark (e.g., product group average margin). Used to quantify margin underperformance.
Formula
s2.AvgMarginPct - s1.AvgMarginPct
Margin Lift Potential
Definition
The potential profit uplift per customer and product group if their margin rate were improved to the midpoint between their current margin percentage and the product group average. This metric estimates the incremental profit that could be realized by partially closing the margin gap, rather than fully reaching the benchmark.
Formula
(s1.Revenue* (s2.AvgMarginPct+s1.AvgMarginPct)/2) - s1.Profit
Current Margin Rate
Definition
The customer’s current average margin percentage, calculated as total gross margin divided by total revenue for the selected period.
Formula
s1.AvgMarginPct
Revenue
Definition
The total revenue generated per customer and product group, calculated as the aggregated sum of invoice prices for all included transactions within the selected period. This metric provides the foundational measure of sales volume used in margin and performance analysis.
Formula
SUM(InvoicePrice)
Suggested Margin Rate
Definition
The recommended target margin percentage for a customer and product group, calculated as the midpoint between the customer’s current average margin percentage and the product group average margin percentage. This metric provides a balanced improvement goal, suggesting a margin rate that is halfway between the customer’s current performance and the group benchmark.
Formula
(s2.AvgMarginPct+s1.AvgMarginPct)/2
Revenue Uplift
Definition
The potential profit uplift per customer and product group if their margin rate were improved to the midpoint between their current average margin percentage and the product group average margin percentage. This metric estimates the incremental profit that could be realized by partially closing the margin gap, rather than fully reaching the benchmark.
Formula
(s1.Revenue* (s2.AvgMarginPct+s1.AvgMarginPct)/2) - s1.Profit
Average Margin Rate
Definition
The customer’s margin rate computed from transaction-level data and aggregated per customer and product group. Calculated as total gross margin divided by total revenue for the selected period.
Formula
SUM(Margin)/ SUM(InvoicePrice)
Reference Margin Rate
Definition
The benchmark margin percentage for a product group, calculated as the weighted average gross margin rate across all transactions within that product group for the selected period. This value serves as the reference point against which individual customer or segment margin performance is compared, supporting the identification of margin shortfall and underperformance.
Formula
s2.AvgMarginPct
Margin Lift Potential Rate
Definition
The potential profit uplift (percentage) per customer and product group if their margin rate were raised to the product group average.
Formula
(s1.Revenue* (s2.AvgMarginPct+s1.AvgMarginPct)/2) / IFNULL(s1.Profit,0) - 1