RFM Segmentation for SAAS Customer Data using SQL

Recency, Frequency and Monetary Value Segmentation for Optimal Customer Engagement in SAAS Products.

What is RFM segmentation, and Why bother with it?

RFM segmentation is an analysis used to identify the most valuable customers for a business. It stands for Recency, Frequency, and Monetary Value. By analyzing customer data based on these factors, companies can segment their customers into groups and tailor their marketing strategies to each group. RFM segmentation can help businesses optimize marketing efforts, increase customer retention, and drive revenue growth. A business can use this technique to identify customers at risk of churn, allowing businesses to implement targeted sales reach-outs, discount campaigns and improve overall customer satisfaction.

A deeper dive into the 3 constituents:

  • Recency: timespan since the customer's most recent purchase. Customers who have purchased more recently are perceived to be more valuable, as they are expected to buy again shortly.

  • Frequency: number of purchases over a timespan. Frequent buyers are more valuable and inclined to make future purchases.

  • Monetary value: total $$$ spent by the customer. High spenders are deemed more valuable since they likely generate more revenue for the business.

Now onto the hands-on part of this article.

Lets Go Wow GIF by The Tonight Show Starring Jimmy Fallon

Analysis

I’ve already generated a dataset with 1000 customer ids, 3 unique products, thousands of orders, 3 pricing plans, and over 1 year.

Here’s how it looks in Bigquery 

Recency: Can be found by calculating the date difference between the current date and the last purchase date for the customer. The lower the difference, the more likely the customer’s next purchase.

Frequency: It is found by calculating the number of transactions per customer per period (1 year).

Monetary value: Total revenue generated by a customer for your business. Customers who spend more are more likely to buy if targeted by marketing campaigns.

Consolidate data into a CTE (Common Table Expression)

This fulfills the prerequisites of aggregating the data based on the customer and the product. Now onto the segmentation.

RFM Segmentation using Quintiles

The SQL NTILE() is a window function that allows you to break the result set into a specified number of approximately equal groups or buckets. It assigns each group a bucket number starting from one. For each row in a group, the NTILE() function assigns a bucket number representing the group to which the row belongs. NTILE()looks like the following:

Using quintiles for customer segmentation can benefit individual product strategy, marketing, and budgeting. By understanding the sales generated by each customer, a business can optimize its strategy to increase profitability for each quintile. This ensures that the business responds to each customer depending on their value.

Ralph Fiennes Customer GIF by Searchlight Pictures

Here are some tactics to utilize results from quintile segmentation.

  1. Minimize promotional spending on the smallest customers, and go all out for the biggest ones.

  2. Charge smaller customers slightly more to balance profitability and encourage spending.

  3. Focus sales efforts on customers in the top 2 quintiles and target more great prospects.

  4. Customize marketing messages to fit each quintile, recognize the relationship, and encourage customers to increase their rankings.

We will segment our customers for the product with id = 101.

If a business discovers that its top quintile for a specific product comprises its most valuable customers, it could prioritize acquiring additional customers through this segment to boost growth and revenue. On the other hand, if the business finds out that the bottom quintile contains its least valuable customers, it could reduce its focus on this segment instead of acquiring more customers in the higher quintiles.

Top Quantile Segments

Let’s utilize our quintiles to divide our customers into these segments:

  • High Value: This group spends more than the average customer, making them high in monetary value, and they have made recent and frequent purchases, showing loyalty.

  • Highly Active: This group may not have the highest monetary value, but they make up for it with consistent engagement, high purchase frequency, and recency scores, indicating loyalty.

  • Churn Risk: This group has low recency and frequency scores, putting them at risk of churning despite having high monetary value. They require targeted marketing efforts to re-engage them with the business.

Transform Data into Value

We can turn this data into value for the customers and the business in a couple of ways.

  • Personalized communication: High-value customers may receive exclusive discounts or early access to new products. In contrast, at-risk customers could receive a special offer to entice them back to the business.

  • Loyalty programs: Create loyalty programs that cater to each customer type. For high-value customers, offer tiered rewards based on spending, while for high-usage and loyal customers, offer rewards based on the frequency of purchases or the number of referrals. For at-risk customers, provide incentives for re-engagement, such as a discount on their next purchase or a gift.

  • Product offerings: Use the RFM segmentation to tailor product offerings to each customer type. High-value customers may be interested in premium products, while high-usage and loyal customers may appreciate bundles or subscription options. At-risk customers may benefit from targeted product recommendations or personalized product suggestions based on previous purchases.

If you liked this article, let me know if I should keep you updated with the next!