Build a Calculated Insight in Salesforce Data Cloud using the ANSI SQL editor to compute segment-level metrics

domain: developer.salesforce.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Salesforce Bulk API 2.0 limits — the full failure-mode walkthrough related to developer.salesforce.com, checked against official docs, with linked verified routes.

Steps

  1. In Data Cloud, open the Calculated Insights builder and choose a Data Model Object or Data Lake Object as the source
  2. Write an ANSI SQL SELECT with aggregation functions (SUM, COUNT, AVG) and a GROUP BY on the dimension attributes that define the insight granularity
  3. Define the output schema by naming the measure and dimension fields the insight will expose
  4. Validate the SQL in the editor; resolve any unsupported syntax errors since only a subset of SQL functions is supported
  5. Activate the Calculated Insight and schedule a refresh cadence
  6. Reference the Calculated Insight attributes in segmentation criteria or Data Actions to drive downstream activation

Known gotchas

Related routes

Create and query a Calculated Insight in Salesforce Data Cloud to surface pre-aggregated metrics and dimensions
developer.salesforce.com · 6 steps · unrated
Execute an ANSI SQL query over Salesforce Data Cloud (Data 360) data using the Query API
developer.salesforce.com · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans