How do I do RFM segmentation of customers with iDBQuery?
Ask iDBQuery 'Score every customer on recency, frequency, and monetary value, and group them into segments like champions, at-risk, and lost.' It writes the ranking SQL over your orders table, returns the RFM segments as a table and chart, and cites each customer's score to their transactions.
RFM segmentation ranks customers on three behaviours: how Recently they bought, how Frequently, and how much Monetary value they bring. It is a proven way to find your best customers and those slipping away, but it takes quantile maths that iDBQuery handles for you.
- You'd ask iDBQuery: 'Build an RFM segmentation from the orders table: score each customer 1-5 on recency, frequency, and spend, then label segments such as champions, loyal, at-risk, and lost.'
- It computes the percentile scores, assigns segments, and returns a distribution chart plus a per-customer table.
- Each customer's placement is cited to the orders behind it, so 'this account is at-risk' is backed by real recency and spend rows.
From there you can act: 'List the 200 at-risk customers with the highest historical spend and their last order date,' ready to hand to marketing. Because customer names, order history, and email engagement often live in different systems, iDBQuery's one live model merges them into a single answer with no ETL. You can also save the segmentation as a shareable report that refreshes on live data, so the 'champions' list is always current rather than a stale export.
Updated 2026-06-22