What a Calculated Insight Is
A Calculated Insight is a precomputed, periodically refreshed metric stored as a Data Cloud object. It aggregates data across DMOs into single values per individual, per account, or per any grouping you choose.
Examples:
- Total purchase amount per individual, last 90 days.
- Average session duration per account, last 30 days.
- Count of open support cases per account.
- Days since last login per individual.
Insights are the answer to the question “can I segment on X?” where X is not a field on any single DMO, but something computed.
How They Differ From Real-Time Queries
You can compute the same metrics on the fly at segment-build time. But for real-time use cases (Agentforce grounding, activation push), the segment needs data already materialized. Calculated Insights compute the metric once and store it; downstream uses it instantly.
Think of them as materialized views. Computed on schedule, queried at runtime.
Anatomy of an Insight
Each Insight has:
- A SQL-like query defining the aggregation.
- Grouping keys (for example,
Individual.Id) that define the granularity of rows. - Output fields (measures and dimensions).
- A refresh schedule (on-demand, hourly, daily).
The result is a DMO you can use in segments, activations, and grounding.
Building an Insight: Example
You want “Total Spend Last 90 Days” per Individual. The inputs: Order DMO and Order Product DMO.
In Data Cloud Setup → Insights → New Calculated Insight:
SELECT
ssot__Individual__dlm.ssot__Id__c AS IndividualId,
SUM(ssot__Order__dlm.ssot__Amount__c) AS TotalSpend90d
FROM
ssot__Order__dlm
JOIN ssot__Individual__dlm
ON ssot__Order__dlm.ssot__BuyerId__c = ssot__Individual__dlm.ssot__Id__c
WHERE
ssot__Order__dlm.ssot__OrderDate__c >= DATEADD(day, -90, CURRENT_DATE())
GROUP BY
ssot__Individual__dlm.ssot__Id__c
The result is a new DMO — call it TotalSpend90d__cio — with one row per Individual and a TotalSpend90d measure.
Set the schedule to “Daily at 2 AM.” Save and activate.
Using an Insight
Once built, insights appear as DMOs in:
Segments. “Individuals where TotalSpend90d > $1000.”
Activations. Include TotalSpend90d as an activated field for Marketing Cloud personalization.
Prompt Builder grounding. Agent prompts can merge the insight field into their context: “This customer has spent $1,247 in the last 90 days.”
Einstein predictions. Insights feed into predictive models as features.
Refresh Considerations
Insights are point-in-time. Between refreshes, the value is stale.
Refresh cadence tradeoffs:
- Hourly: near-real-time. Higher compute cost. Use for operational insights (current open cases, active sessions).
- Daily: standard for most use cases. Good balance of freshness and cost.
- Weekly: cheapest. Use for stable trends that don’t change day-to-day.
- On-demand: triggered by Flow or API. Use for event-driven insights tied to specific actions.
Before scheduling, ask: “If this insight were wrong by 23 hours, would a downstream decision be wrong?” If yes, refresh more often. If no, daily is fine.
Streaming Insights
Some metrics can’t wait for a batch refresh. Salesforce added streaming insights for real-time aggregation:
- Uses streaming ingestion.
- Computes as events arrive.
- Available within seconds.
Use for real-time personalization on websites, ad bidding, or fraud detection.
Streaming insights are more expensive and harder to debug. Don’t use them where batch would do.
Common Patterns
Recency Insight
Days since last interaction.
SELECT
IndividualId,
DATEDIFF(day, MAX(EngagementDate), CURRENT_DATE()) AS DaysSinceLastEngagement
FROM
Engagement__dlm
GROUP BY IndividualId
Use for churn-risk scoring, re-engagement triggers.
Frequency Insight
Count of interactions in a window.
SELECT
IndividualId,
COUNT(*) AS EngagementCount30d
FROM
Engagement__dlm
WHERE EngagementDate >= DATEADD(day, -30, CURRENT_DATE())
GROUP BY IndividualId
Use for active-user segmentation.
Monetary Insight
Sum of transaction values.
SELECT
IndividualId,
SUM(Amount) AS Revenue90d
FROM Order__dlm
WHERE OrderDate >= DATEADD(day, -90, CURRENT_DATE())
GROUP BY IndividualId
Use for VIP identification, upsell targeting.
The three together (recency, frequency, monetary) are the classic RFM segmentation inputs. Ship them early.
Cross-Entity Insight
Aggregations spanning multiple DMOs.
SELECT
AccountId,
COUNT(DISTINCT Case.Id) AS OpenCases,
AVG(Engagement.SessionDuration) AS AvgSessionDuration
FROM Case
JOIN Engagement ON Case.ContactIndividualId = Engagement.IndividualId
WHERE Case.Status = 'Open'
GROUP BY AccountId
Use for account-health scoring.
Common Mistakes
Over-aggregating. An insight with 30 output measures is harder to debug than three insights with 10 measures each.
Filtering at segment time. If every segment computes “active users” from raw events, build an insight instead. Saves compute, speeds segment evaluation.
Ignoring costs. Insights are priced by compute. A complex insight refreshing hourly can meaningfully affect your bill.
No monitoring. Insights can fail silently if source DMOs change shape. Audit refresh status regularly.
Refresh too often. Marketing doesn’t need second-by-second insight freshness. Hourly or daily is usually enough.
Testing Insights
Before activating:
- Query the insight with sample filters and validate counts against a source-of-truth.
- Compare against known-good numbers from a warehouse or finance system.
- Run one full refresh and inspect a sample of rows.
Post-launch, set up a daily “row count” check — if the number of insight rows drops unexpectedly, something upstream broke.
Frequently Asked Questions
Can I reference an insight from another insight?
Yes. Insights can join to other insights, enabling layered aggregations. Keep layering shallow to make debugging tractable.
Can I expose insights outside Data Cloud?
Yes — activations push insight data to Marketing Cloud, external systems, and cloud destinations. You can also query the insight DMO via the Data Cloud Query API.
Do insights count against my Data Cloud storage?
Yes. Insight output is storage. Factor into capacity planning.
How do I version-control insights?
Data Cloud insights are metadata; they deploy via metadata API, change sets, and SFDX. Git-track the metadata like any other deployable artifact.