Features · Segments and activation
Calculated insights
The insight's page, its SQL, its runs and credits per run.

Video coming soon.
From the article Did my calculated insight run, is its SQL right, and what does it cost? (part 22 of the series).
Calculated insights are where a lot of Salesforce Data Cloud logic ends up: lifetime value, days since the last order, engagement scores. They are also where the quiet failures happen. An insight that stopped running last week still has data in its table, so segments built on it keep publishing, with numbers that are a week old. And when someone asks how many credits an insight uses, the answer is usually a shrug, because its runs are not listed anywhere next to it.
The list
The Insights page, All calculated insights, shows every calculated insight in the data space with its data space, status, last run time, last run status (with a status dot), schedule in words, such as "every 24 hours", insight type and the number of dimensions and measures. A search box and a status menu narrow it, and Download gives the list as a document or a spreadsheet. My demo org has three: two that came with Personalization, and DCI Demo Web Engagement, which counts page views per person and device and has not run yet.
Check all calculated insights, next to the search box, runs the SQL check over every insight at once. It uses the SQL the list already loaded, so it sends no queries. The table gives the number of errors, warnings and notes per insight and its first finding, and each name opens that insight's Expression tab.

The one error is in SQL that Salesforce wrote, which is a good reminder that the check reads the text and does not care who wrote it.
The record page
Open an insight and the header gives its label and API name, with three buttons: Query in SQL (a SELECT of its dimensions and measures in a new SQL tab), Download, and Open in Salesforce. Under them sits a strip with the data space, status, last run, last run status and schedule.
Below that, seven tabs:
- Details: the insight type, schedule, definition status, partition field, query dialect, and the last run error when there is one.
- Expression: the SQL, formatted, with Copy SQL, Open in a SQL tab, and the SQL check under it.
- Output: the dimensions and measures with their role, type, aggregation and formula.
- Data: the first 50 rows of the insight's table, with a Table menu for its other tables.
- Used by: the objects and fields its SQL reads, and the segments that use it.
- Runs: the last run, and every run that used credits.
- Cost estimate: credits per run and per month.
The Data tab also has Filter by: pick a column, paste up to 1,000 values (a list of individual IDs, for example), and Run shows only those rows. Open this SQL in a SQL tab takes the same query to the SQL page.
The SQL check on the Expression tab
Day 4 covered the SQL check on the SQL page. On a calculated insight it adds rules of its own, because Data Cloud expects more of an insight's SQL than of a plain query:
- An insight without a measure is an error, and one without a dimension is a warning.
- A measure without an aggregate function is an error.
- An output name that does not end in __c is an error.
- ORDER BY or LIMIT in an insight is an error.
- No dimension that looks like a person or account ID is a note: to use the insight in segments on people, it needs a key such as the Individual ID.
The general rules apply too: unknown objects and fields, missing GROUP BY columns, = NULL, and syntax from other SQL dialects. Findings are listed errors first, then warnings, then notes, so the one that breaks the insight is at the top. Each finding gives its line and column in the formatted SQL above it, so the numbers match what you see. The Expression tab label carries the count of errors and warnings, so you notice them before opening it. Rules turns a rule off in this browser, as on the SQL page.

Line 8 compares a field with = NULL, which is never true, so that branch of the CASE never fires and empty root IDs fall through to the ELSE. The engagement notes (DC016 and DC018) matter more for cost than for correctness: they point at the large object every run reads in full.
Runs and credits per run
The calculated insight API gives only the last run, so the Runs tab starts with that. The Last run card shows when it started, its status, its duration and its row count. Duration and rows say "not given by the org" when the record does not have them, which is the case on my demo org, and every run field the record does have is listed under Run fields in the insight record.
Runs over time goes further, using Data Cloud's own billing data. When the org has the Digital Wallet usage events in the data space, each insight run that used credits leaves events behind. Read the run history (for the last 30, 90, 180 or 365 days) groups those events by hour into one row per run, with the rows processed and the credits used.
The result has four tiles (runs, rows processed, average rows a run and credits), two bar charts (rows processed per run and credits per run), and a table of every run. Hovering over a bar shows that run's rows, its change from the run before, its credits, the number of events and the usage type. The line above the tiles names the usage object it actually read: TenantEnrichedUsageEvent when the data space has it, else the hourly consumption object. Open the query in SQL shows how it was read.

The demo insight's three runs read 3 rows each, so the bars are level. A sudden drop in rows processed is the shape I look for first: it usually means a data stream upstream stopped feeding the insight. An insight with no events in the period, like DCI Demo Web Engagement, gets "No usage events for this insight in the last 180 days: it has not run, or its runs used no credits, or the events name it differently." Without the Digital Wallet objects, the tab says so and links to Credit prediction, which explains how to turn them on.
The cost estimate
The Cost estimate tab is the same card as on a segment, covered on Day 19. For an insight, the objects read are the ones named in its SQL, the usage type defaults to Batch calculated insights (or Streaming calculated insights for a streaming insight), and the runs a month come from its schedule, so DCI Demo Web Engagement, every 24 hours, counts 30 runs.
The two tabs check each other. If the estimate and the credits per run on the Runs tab are far apart, either the insight reads less than its whole objects, or the rate behind the estimate does not match your contract.
Limits
A few things to know:
- No run history endpoint is known, so the history comes from usage events. Failed runs and run durations are not in those events.
- Runs are grouped by hour, so two runs in the same hour show as one.
- Rows processed is read from the usage value of the events, which I assume to be rows for calculated insight usage.
- Credits per run are rounded, so tiny runs show 0 per run while the total tile adds them up to 0.0001.
- The SQL check reads the SQL text and the object list. It cannot tell you whether Data Cloud will accept the insight, and its findings never block anything.
- The cost estimate has the same limits as on segments: list rates, every row counted, an estimate rather than a bill.
The Inspector is free on the Chrome Web Store: https://chromewebstore.google.com/detail/data-cloud-inspector/ghiojkipoephhlkcgcgochoihogiahog