Skip to Content
Technical Articles

Measure brand love and customer value in SAP Marketing Cloud using a RFE-based score


Welcome to the blog posts of the SAP CX Services Marketing Practice.

We are happy to share with you our experience around Marketing Business, Technology and Analytics.

You want to see more blogs from us? Click here.


Scores can be used in SAP Marketing Cloud to quantify customer behavior. Apart from data-driven predictive / machine learning scores, it’s also possible to setup heuristic scores. Such rule-based scores are typically defined based on company policies or best practice. The score logic is built explicitly through calculations and rules.

This blog will outline an implementation of a complex heuristic score based on a variation of the industry-proven RFM (recency, frequency, monetary) model.

User story and business question

In the literature, the RFM analysis is a technique to quantify which customers are the most valuable customers. The most valuable customers are determined by examining how recently they purchase (Recency), how frequent they purchase (Frequency) and how much they spend (Monetary).

In our approach, we generalized from only taking (monetary) sales transactions into account and rather use SAP Marketing interactions to calculate a score. In a nutshell, every potentially marketing-relevant event such as a website registration, a post on social media or an opened email can be a created in SAP Marketing as an interaction. The resulting three dimensions in our approach are:

  • Recency: How recently did the customer interact?
  • Frequency: How often did the customer interact?
  • Engagement: How valuable are the interactions the customer did?

Using this broader RFE definition, we can also quantify how loyal and engaged a customer is. Every customer receives a value between 1 (least loyal and engaged) and 5 (most loyal and engaged). As with every other heuristic score in SAP Marketing Cloud, they can be used in the segmentation or displayed in the contact details / factsheet for individuals – here, the resulting score has been called “Brand Love Score”.

[A modified version of this score can be created, taking only monetary sales orders into account to model the traditional RFM score]

Heuristic score extensibility

With SAP Marketing Cloud, heuristic scores are created using the Score Builder app. Using multiple rules, several conditions can be checked. A rule is valid if all conditions are met. The final score value is calculated as aggregation of the outcomes from all valid rules.

Each condition can be based on either the predefined vocabulary in the SAP HANA Rules Framework (HRF) or on fields which extend the HRF vocabulary. There are two approaches to extend the HRF vocabulary:

  1. via custom fields which already extend the standard SAP Marketing business objects (interaction contact, interaction etc.) using the “custom fields and logic” app
  2. via attributes from custom HANA views

When extending the vocabulary using 1), these custom fields [e.g. the customer’s “shoe size”] can be directly used in a rule condition:

IF(customer_extended.shoe_size > 42) THEN (add 10 to shoe_score)

By using attributes from custom views, additional logic can be implemented in the underlying HANA view. Everything what’s possible in graphical calculation views (e.g. through filters, aggregations, calculated columns) can be provided by the custom view as an output and used later in a rule condition. In this example, the total number of public tweets in the last 6 months could be calculated dynamically through an aggregation on interaction data and provided by the custom HANA view:

IF(custom_view.total_number_tweets_last_6_months > 10) THEN (add 5 to twitter_score)

This illustration shows the technical architecture of a score, whose HRF vocabulary has been extended by a custom graphical calculation view. Through the HRF vocabulary, business data can be used directly or via the custom graphical calculation views.


The implementation can be grouped into the following four steps:

Implementation of score-specific logic via custom HANA views

Our implementation of the score is done by implementing the RFE-specific (recency, frequency, engagement) logic in the underlying HANA views. In a nutshell, the HANA view calculates intermediate results and the score builder uses these and provides the final score value to the SAP Marketing applications such as the segmentation or the consumer profile.

An exemplary calculation done by our score is illustrated below. For a given customer, his/her behavior can be categorized by the three dimensions recency (divided in five time buckets on the x-axis), frequency (divided in five frequency buckets on the y-axis) and engagement (illustrated by the value shown on the chip, representing single interactions). The most current time bucket is on the left hand side of the x-axis and the bucket with the most interactions is on top.

The final score value is calculated in that way:

  • The value of a filled cell is calculated by multiplying recency (5;2;1;1/3;1/12) by frequency (5;4;3;2;1) by the interaction values (based on the customer’s score parameters)
  • All relevant (filled) cells are summed up in a second step
  • In a last step, this result is classified into buckets of 1-5 (based on the customer’s score parameters)

In this example, four interaction types have been identified by the business to be relevant for the RFE analysis: Website visits, product/service reviews, surveys and registrations. These interactions have a different impact on the engagement value (e.g. survey = 75, website visit = 15).

However, you can identify from this example that although the registration interaction (on the right side) has a quite high interaction value (100) the actual effect (0.25) on the score (67.25) is quite low.  Intentionally, because the customer registered a while ago, it’s effect on the score gets lowered.

The generic HANA view which implements this calculation could look like the one below. The intermediate results per time bucket (R1-R5) are calculated individually and later summed up in the top aggregation node. This calculation is done for all relevant interaction types (e.g. visits, review, survey and registration). Another HANA view takes the results per relevant interaction type and calculates the final result.

Parameterization of the score via Custom Business Objects

In SAP Marketing Cloud, with the help of Custom Business Objects (CBOs) one can bring in own business objects which typically hold business data. However, custom business objects can essentially hold any type of data such as score parameter data as well. We use this concept to

  1. manage the custom score parameters (such as the size of the time buckets) in a flat CBO [Recency_1 = 30 days, Recency_2 = 60 days, …] with exactly one intended entry
  2. the assignment of interaction values to interaction types (e.g. the registration = 100 assignment) in another CBO with n [interaction_type; interaction_value] key-value pairs

Using this concept, each customer can set up it’s own version of the score based on their business/industry. As Fiori applications can be generated for the maintenance for Custom Business Object data, the task of setting up the parameters can be fully done in the SAP Marketing UI. It’s also possible to adapt the values at any point in time later. As heuristic scores are (in the default setting) calculated in real time, the adapted parameters are also immediately taken into account.

In the HANA view the configured parameter values can be used as input parameters for the underlying logic. In this screenshot, YY1_03F588E6A526 is the technical name of the DB table which got generated for the CBO and the columns are used here as input parameters.

The illustration below shows the final technical architecture. The HRF vocabulary of the score is extended by a custom graphical calculation view. The view itself does not only take business data but also the score parameters for the final calculation into account. The maintenance of the score parameters can happen on the UI via a Fiori application which can be generated for the CBO.

Extension of the HRF vocabulary

After the custom business objects for the score parameters and the custom graphical calculation views for the score logic have been setup, the standard procedure to extend the HRF vocabulary applies.

This procedure is well described in the Extensibility Guide for SAP Marketing Cloud.

Setup of the heuristic score via Score Builder

The very last step of the setup is the score itself which consumes the results from the HANA view.

As the HANA view already returns the score value directly in the format [Contact_Key; BrandLoveScore], we don’t need any additional logic in the score builder. Of course, depending on the business requirement, the custom attribute can be used in a condition with standard fields as well.

The score can then be made available for the usage in segmentation and in other applications such as the consumer profile.


Following that approach, we have built a parameterizable RFE score in SAP Marketing Cloud via

  1. custom graphical calculation views (for the score logic)
  2. custom business objects (for the score parameters)
  3. the standard score builder (for the score consumption)

Our algorithm comes with best practice parameters to calculate the score.

If you are interested in more detail in the score implementation, don’t hesitate to contact us, the Expert Services Marketing Practice.

The score has already been implemented at several customers, mostly from the consumer products and retail industries. As described, every customer can adapt the parameters for their business/industry and markets.

You want to see more articles from SAP Services? Click on the banner below.

Your SAP CX Services – Marketing Practice team.

Be the first to leave a comment
You must be Logged on to comment or reply to a post.