RFM Analysis

RFM analysis is a method used to segment a company's customers based on their value to the business. It is widely used in marketing, direct marketing, and particularly in retail and services.

RFM analysis considers three measurements, answering the following questions:

  • Recency: How recently did the customer make a purchase?
  • Frequency: How often did the customer make purchases?
  • Monetary value: How much did the customer spend?

To explore this algorithm's implementation in Megaladata, open the workflow on the Demo Stand or download it for your Megaladata app.

Launch demo

Download example

Algorithm Description

1. Input Data

a) Data Import

At the first step, we import customer data, configuring the fields as follows:

Name Caption
 date Purchase date
 client Client ID
 total Purchase amount

Table: Clients

2. RFM Analysis

We created a supernode called RFM-analysis to encompass all the segmentation model. It consists of the following nodes:

a) Last Purchase, quantity, total sum

The Grouping node calculates the total amount,the number of purchases, and the date of the last purchase for each client.

We configure the Grouping node as follows:

  • Field Client ID โ€” moved to Group
  • Field Purchase date โ€” moved to Parameters, with aggregation options Count and Maximum
  • Field Purchase amount โ€” moved to Parameters, with the aggregation option Sum
b) Purchase recency

The node Purchase recency computes the number of days between a given date and the date of the last purchase. In this example, the date 01.01.2008 is set as the input in the Input variables port. (To open the variables' configuration wizard, double-click on the semi-circular Input variables port on the left side of the node, or click it with the right mouse button and choose Configure port. To learn more about ports in Megaladata, please refer to the User Guide.)

c) Binning

The Binning node divides the clients into three groups based on the recency of purchase, the number of purchases, and the amount of money spent.

As a result, each customer will have their respective Recency, Frequency, and Monetary values from 1 to 3. If more detailed analysis is required, the number of groups can be increased, that is, the values may range from 1 to 5 or even from 1 to 10.

d) RFM

The RFM node is created using Megaladata's Calculator component. It employs the concat function to combine the Recency, Frequency, and Monetary values into one column.

Examining the resulting table, we conclude that customers with higher RFM scores are more valuable. These individuals make frequent purchases and spend signinficant amounts. The company should prioritize these high-value customers by offering exclusive benefits like private sales or personalized discounts.


Further reading:

Market Basket Analysis

Download and open the file in Megaladata. If necessary, you can install the free Megaladata Community Edition.

Download example

results matching ""

    No results matching ""