Earn a Salesforce AI Certification by IIT + 12-Week Internship Secure Your Spot Today!

Earn a Salesforce AI Certification by IIT + 12-Week Internship Secure Your Spot Today!
Salesforce Data Cloud Segments and Calculated Insights

Salesforce Data Cloud Segments and Calculated Insights

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.

data cloud blog ctaUnderstanding 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.

AD 4nXdOCDpe4aFfjGqHjfZPygiJpTedGIrNtTlqrZdYSkPsHsJ6FYcgXlPTTW4Y9

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.

AD 4nXfm9hF FakvYQCjSiWeB4ZEvu3k9DyKarSHsfc50pqQZWLXJAR91knS7i9m7ili9lK 4isBoTjNZsQz9vGFwkWJ1c 40RZw1LS6162bpsD9kScKZsIqpsYIvIALnVTRTZNm0jA

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:

  1. Sum of Loyalty Points: We start by summing the loyalty points from the Sales Order object.
  2. 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.
  3. Traversal to Unified Individual: The Unified Link Individual object is then joined with the Unified Individual object using the “unified record ID.”
  4. 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.

AD 4nXeTLyu IYxJIouY qfj4d2mCDxKxs5jVX8cc7BAB cNJP7CRD31cq9Z5HpOnM7tswgvW R7l41zP4W55GR7fuQjLxg4oRTAvO3ehqx9mQSkyWiHoGQrvFVT MmgV

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.

AD 4nXfJRZngBfLpJX4k4iTSh7B6BmLieeQZXkUKKYRyBSZbMUH54oB3iZVDuWes U9vdKBQeUr1tYXhRp0vLnBYS5ZX1U VQ5Z8uB jk2ObU4BnnZmYxhk0qQVUTTgE B12hdCIMfJV14 AoAru8aW 702n0U4A?key=uik9FczWCqqcV8pNN0rV2A

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.

AD 4nXe5WV0T8XnHFY3fda CoQ0XCERkKVaSvfkvZoTCnjJvYWBpxQtdIdWymqk0YomfCcdKGyPrw4qQJRYcoSHsrS2jmsFmISJIaZyyu8m0TknnuAjKTrrtLOdYlxLZla6xD6Tz 0taLiV2H8I5ycDjsZywsLaK?key=uik9FczWCqqcV8pNN0rV2A

AD 4nXcY3NufuYIcp8FfqY7TqIX3FJy3acb d LL5mhUYKZoenKJgQP IiNE6AAzF1mb9c 5gGjLVt7cc mopuLUqwgDC9fuH0dNZnnmMjK7tKFqanpw2qwSHM8zUajgLqAg2bXGfTjg52Ue556K8UlE88hLWJh?key=uik9FczWCqqcV8pNN0rV2A

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!

Table of Contents

Subscribe & Get Closer to Your Salesforce Dream Career!

Get tips from accomplished Salesforce professionals delivered directly to your inbox.

Looking for Career Upgrade?

Book a free counselling session with our Course Advisor.

By providing your contact details, you agree to our Terms of use & Privacy Policy

Unlock Your AI -Powered Assistant

Gain Exclusive Access to Your Salesforce Copilot

Related Articles

Mass Assign User Permission Set in Salesforce

Learn how to efficiently mass assign user permission sets in Salesforce using tools like Data Loader. Save time and ensure accuracy. Read now!

How to Clone a FlexCard in Salesforce

Learn how to clone a FlexCard in Salesforce with this step-by-step guide. Simplify customization and boost efficiency effortlessly!

Salesforce Introduces Agentforce 2.0: Redefining How Work Gets Done

Salesforce introduces Agentforce 2.0, the AI platform transforming digital labor with autonomous agents and seamless workflows. Read now!