Unprofitable Long-Tail Customer Agent (Formula Expressions)

Average Margin Percentage

Definition

:question_mark:

The customer’s margin rate computed from transaction‑level data and aggregated per customer (conceptually margin divided by revenue).

Formula

SUM(Margin)/ SUM(InvoicePrice)

Revenue Rank

Definition

:question_mark:

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 Rank

Definition

:question_mark:

The customer’s position when customers are sorted by margin rate or margin contribution, enabling comparison to revenue rank.

Formula

PERCENT_RANK(SUM(Margin))

Margin Variance

Definition

:question_mark:

The difference between a customer’s margin rate and the relevant benchmark (e.g., segment average); used to quantify underperformance magnitude.

Formula

s1.AvgMarginPct - s2.AvgMarginPct

Margin Lift Potential

Definition

:question_mark:

The potential profit uplift per customer if their margin rate were raised to the segment average.

Formula

(s1.Revenue* s2.AvgMarginPct) -  s1.Profit

Margin Lift Potential Percentage

Definition

:question_mark:

The potential profit uplift (percentage) per customer if their margin rate were raised to the segment average.

Formula

(s1.Revenue* s2.AvgMarginPct) / IFNULL(s1.Profit,0) - 1

Revenue Uplift

Definition

:question_mark:

Estimated additional revenue that could be realized if the identified underperforming customers’ pricing/margins are improved toward average levels (where relevant to the scenario).

Formula

(s1.Revenue* s2.AvgMarginPct) -  s1.Profit

Current Margin Rate

Definition

:question_mark:

The product’s margin rate in the current period, calculated as total margin divided by total invoice price for the product.

Formula

s1.AvgMarginPct

Segment Margin Rate

Definition

:question_mark:

The average margin rate for the relevant product segment in the current period, calculated as total margin divided by total invoice price for all products in the segment.

Formula

s2.AvgMarginPct

Suggested Margin Rate

Definition

:question_mark:

A recommended margin rate, calculated as the average of the product’s current margin rate and the group average margin rate.

Formula

(s1.AvgMarginPct + s2.AvgMarginPct)/2