The RFM engine that taught Coca-Cola's eB2B who to talk to.
Trade marketing was blasting the same promo to every outlet on CokeBuddy. No one knew which stores were champions, which were slipping, or which were worth a discount. This is how I built — and shipped — the segmentation engine that changed the conversation.
Trade marketing was blasting the same promo to every outlet on CokeBuddy. No signal for which stores were champions, which were slipping, which were worth a discount.
Built an RFM scoring engine on OneLake that merges offline DMS sales with in-app eB2B orders. Pipes segment membership to MoEngage every night at 2am.
Win-back offers stopped landing in the inboxes of outlets that ordered yesterday. Champions got breadth plays. Measurable uplift per cohort — especially on frequency.
How the data flows.
The 11 cohorts, visualized.
WITH base AS (
SELECT outlet_id,
DATEDIFF(day, MAX(order_date), CURRENT_DATE) AS recency_days,
COUNT(*) AS frequency,
SUM(net_value) AS monetary
FROM silver.unified_orders
WHERE order_date >= DATEADD(month, -12, CURRENT_DATE)
GROUP BY outlet_id
), scored AS (
SELECT outlet_id,
NTILE(5) OVER (ORDER BY recency_days ASC) AS r_score, -- 5 = most recent
NTILE(5) OVER (ORDER BY frequency) AS f_score,
NTILE(5) OVER (ORDER BY monetary) AS m_score
FROM base
)
SELECT outlet_id, r_score, f_score, m_score,
CASE
WHEN r_score=5 AND f_score=5 AND m_score=5 THEN 'champions'
WHEN r_score=1 AND f_score>=4 THEN 'cant_lose_them'
WHEN r_score>=4 AND f_score>=4 AND m_score>=4 THEN 'loyal_customers'
WHEN r_score<=2 AND f_score>=3 AND m_score>=3 THEN 'at_risk'
WHEN r_score=5 AND f_score=1 THEN 'recent_customers'
WHEN r_score=4 AND f_score=1 THEN 'promising'
WHEN r_score>=4 AND f_score>=2 THEN 'potential_loyalist'
WHEN r_score=3 AND f_score>=3 THEN 'needing_attention'
WHEN r_score=3 AND f_score<=2 THEN 'about_to_sleep'
WHEN r_score<=2 AND f_score=1 THEN 'lost'
ELSE 'hibernating'
END AS cohort
FROM scored;Order frequency moves measurably.
Coca-Cola MY/SG
Where I'd take it in Q4.
Model which Potential Loyalist outlets are likely to tip into Champions given a nudge.
Factor promo cost per cohort into activation decisioning.
Decouple Ramadan, CNY, and Merdeka from the baseline trend.
Blend RFM with 3-year gross-profit forecast per outlet.