Understanding and leveraging customer loyalty points is crucial for businesses to reward and retain their customers effectively. In this guide, we’ll delve into the process of calculating the sum of total loyalty points accrued per unified individual and individual using Salesforce and AWS S3.
We will explore how these points are stored, linked, and calculated through Salesforce’s query editor and calculated insights features.
Understanding the Storage of Loyalty Points
Loyalty points are stored in the Sales Order Data Model Object (DMO). To begin, we will use the Data Exploration Query Editor to examine how this data is structured. Within the Sales Order object, loyalty points are stored in a specific column, and customers are linked via the “sold to customer ID” field. Running a query in the editor reveals the loyalty points accrued for various orders placed by customers.
Querying Individual and Unified Individual Data
Next, we must consider how engagement-related information links to individual records. This involves querying the Individual and Unified Individual objects. The key fields of interest are the individual IDs from both objects. Additionally, we need to understand how the Unified Individual and Individual objects are connected through the Unified Link Individual object. This linkage is essential for accurately consolidating loyalty points across different data sources.
Also Read: Effective Data Object Mapping From Salesforce CRM to Data Cloud
Creating the Query for Calculated Insights
To calculate the sum of loyalty points, we need to construct an SQL query that sums the loyalty points from the Sales Order object and joins it with the relevant fields from the Unified Individual and Individual objects. Here is the detailed query breakdown:
- Sum of Loyalty Points: We start by summing the loyalty points from the Sales Order object.
- Joins: The query joins the Sales Order object with the Unified Link Individual object on the “sold to customer ID” and “source record ID” fields.
- Traversal to Unified Individual: The Unified Link Individual object is then joined with the Unified Individual object using the “unified record ID.”
- Traversal to Individual: Finally, we join the Unified Link Individual object with the Individual object using the “source record ID.”
The final query includes a GROUP BY clause to aggregate the loyalty points by the Unified Individual and Individual IDs.
Also Read: Mapping of Engagement Data From AWS S3 DLO to DMO
Creating Calculated Insights
With the query ready, the next step is to create the calculated insight in Salesforce. Navigate to the Calculated Insights section and create a new insight using the SQL query. Name the insight “Total Loyalty Points per Customer” and verify the query syntax. After successful validation, activate the insight and choose a scheduling option. For this example, we select the “not schedule” option and publish the insight, initiating a batch process to calculate the insights.
Verifying the Calculated Insights
After the batch process completes, we can verify the results by querying the “total loyalty points per customer” calculated insight object. Using the Data Exploration Query Editor, we query this object to see the total loyalty points for each customer. Ordering the results by total loyalty points in descending order reveals which customers have accrued the most points.
Explore our Salesforce Data Cloud series on YouTube for expert guidance and tips on leveraging Salesforce Data Cloud effectively.
Conclusion
By following this guide, you can effectively calculate and analyze customer loyalty points using Salesforce and AWS S3. This process involves understanding how data is stored and linked across different objects and creating calculated insights to aggregate and report on this data. Leveraging these insights allows businesses to understand customer behavior better and enhance their loyalty programs.
Looking to improve your Salesforce expertise? Explore our Salesforce Data Cloud Consultant course. Start a free trial to access over 24 Salesforce certification courses, more than 50 mock exams, and 50+ hands-on Salesforce labs.
Elevate your career and simplify your learning journey with saasguru today!