Analyse data in the Analytics workspace
Answer a question about your plant’s history that no report answers yet, for example “the 10-minute averages of both reactors yesterday afternoon” or “which alarms came most often last week”, without saving anything to the project. When the answer is useful to others, turn the query into a dataset that reports can use.
The Analytics tab of the Analytics and Reports workspace (Pro and Enterprise) runs your own read-only SQL over one source: the historian (samples) or the alarm journal (alarm_events, alarm_definitions). To join both, read them into extracts first (Combine sources with extracts and pivot on the server). It uses the same relations, columns and quality helpers as the datasets (Relations and columns).
You need:
- the right
analytics(a new installation gives it to Lead_Engineer; Grant report rights); - for Save as dataset, also
datasets_edit; - a tablet or a computer: on a phone the tab says “The analytics workspace needs a wider screen”.
A query reads as you. It runs through the same path as a dataset of a report: your tag read rights decide which rows exist at all. A user allowed only Plant/A/> gets area A’s rows in every count, average and join, never another area’s, whatever the SQL says. The stored tables, files and table functions cannot be named. Tags your rights hide are counted, never named (A report shows only what you may read). Nothing in the workspace writes a tag or sends a command.
1. Write the query
Section titled “1. Write the query”-
Open Analytics and Reports > Analytics. The tab is shown only to users who hold
analytics. -
Choose the Source: Historian or Alarms.
-
Write the SQL in the editor. It is the shared code editor in SQL mode: it completes the source’s relations and columns, the quality helpers and your
$parameters, and it marks the server’s own errors at their line while you type.SELECT time_bucket(INTERVAL '10 minutes', ts) AS t, tag_path,avg(value) AS value, agg_quality(quality_class) AS quality_classFROM samplesWHERE tag_path LIKE 'Plant/Reactor%'GROUP BY 1, 2ORDER BY 1, 2 -
Keep the quality in the result: return
quality_classnext to the values, oragg_quality(quality_class)in an aggregate, or keep only good samples withWHERE quality_class = 'good'. A query without it still runs here, but its rows are marked as not known good (step 4).
2. Set the time window and the parameters
Section titled “2. Set the time window and the parameters”- Time window (required): Last hour, Last 24 hours, Today, Yesterday, Last 7 days, or Custom with From and To. Every query is bound to it: the relations hold only the rows inside it. It spans at most
reports.max_window(400 days). - Parameters: each
$namethe SQL uses gets a row with its type (timestamp, duration, number, integer, text, bool, tag, tag list) and a value. Atagortag_listvalue you may not read is refused before the query runs.
3. Run it
Section titled “3. Run it”- Run (Ctrl+Enter) runs the whole text; Run selection (Ctrl+Shift+Enter) runs only the selected text.
- Cancel stops your running query: “The query was cancelled.”
- The status chip says how many rows came back and how long it took (“36 rows in 48 ms”). A second chip sums up the quality (“2 uncertain”, or Query ignores quality).
An error in the SQL is shown under the editor with its line and column (“Line 2, column 8: Unknown column …”), and the editor marks that line, also when you ran a selection.

4. Read the values
Section titled “4. Read the values”The Values tab shows the rows in the data grid: filter and sort each column, filter all rows with Filter rows, and Export CSV (the rows in the grid). To take the whole result as a file, use Export in the toolbar (Export analytics results).
Quality is marked, never guessed.
- When the result has a quality column (
quality_class, elsequality, in any case), each row carries the class the server gave it. A row the server classes bad or uncertain has a marker in the ! column and an amber or rose accent; click the marker for the explanation (“The server classes this row as bad: at least one of its samples is bad. Do not read it as a plant value.”). - A historian query that reads
valuewithout its quality is answered with Query ignores quality: the same rule that refuses such a dataset on save. The server then marks the rows that may hold bad or uncertain samples: with atag_pathcolumn, the rows of the tags that have non-good samples in the window; without one, every row when the window holds any. Their marker says May include non-good samples and offers Add quality column, which rewrites the query with the quality column. - The chip above the grid (“2 rows not known good”) filters the grid to the marked rows.
- Simulated rows carry SIM and a Simulated marker.


Large results. The workspace reads the result in pages of 10,000 rows (“Reading rows … of …”). A query returns at most analytics.max_rows rows (100,000 by default); beyond that the notice says “Only the first N rows are shown (the limit for the browser). Export the whole result as a file.” Then:
- Export the whole result writes every row to a CSV, Excel or Parquet file on the server (Export analytics results);
- Pivot on the server groups the whole result on the server into row groups and a pivot column (Pivot a large result on the server);
- or narrow the window, group the rows, or add a
LIMIT.
5. Chart it
Section titled “5. Chart it”Open Chart (or Split, beside the grid on screens 1600 pixels wide and more; the tab you used last is remembered):
- Chart type: Line, Bar, Scatter, Pie or Heatmap.
- X axis: a column, often the time.
- Values (Y): one or more number columns.
- Series by (optional): a column whose values split the rows into one series each, such as
tag_path.
A line over a time column is drawn as a trend, with zoom. Rows that are not known good are never drawn like good ones: an uncertain value is dashed, a bad one a gap with a band, and other charts draw such points hollow, dashed and faded, with the quality in the tooltip. The legend toggles series; the icons above the chart export a PNG and a CSV of the plotted data. The chart says when it draws only the first series or x values.

6. Save the query, or make it a dataset
Section titled “6. Save the query, or make it a dataset”- Save query keeps the query in Saved queries under a name. Saved queries are yours: no other user sees them, and they are not project content (not in checkpoints, project archives or HA replication). The parameters’ last values are kept; the time window is not, you choose it at each run. Open a saved query… loads one; Delete saved removes your copy only. At most 200 per user.
- Save as dataset (needs
datasets_edit) turns the query into a dataset that reports can use: give a Name, an ID (ds_..., fixed once saved), an optional Description and the Tag scope (the tag patterns it may read). The server checks it as every dataset save is checked, the quality rule included: a historian query that ignores quality is refused here, with Add quality column. See Create a report dataset.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Rows per query | analytics.max_rows (default 100,000); the result is cut there and says so |
| Time per query | analytics.query_timeout (default 60 s) |
| Size of one result | 64 MiB |
| Time window | reports.max_window (default 400 days), always required |
| Running queries | analytics.per_user (default 1) per user, and analytics.workers (default 2) on the server, queries over extracts included; one more is refused (“too many queries running”, 429 ANALYTICS_BUSY), never queued |
| Results kept on the server | your last result only, for 10 minutes without reading, 16 on the server |
| Parameters | 32 per query |
| Saved queries | 200 per user |
SQL on DuckDB 2.0
Section titled “SQL on DuckDB 2.0”Queries, report datasets and the AI co-pilot’s SQL run on DuckDB 2.0. A query written for an earlier version may need a change:
- the arrow form of a lambda,
x -> x + 1, is refused: writelambda x: x + 1; ~matches part of a text, not the whole text;- an integer division or modulo by zero is an error, not NULL;
- any error inside a transaction ends that transaction.
Who may use it
Section titled “Who may use it”- People with the
analyticsright only. An API token is refused on every analytics route (403 REPORTS_TOKEN), and so is the AI co-pilot, whatever its rights (403 REPORTS_AI); the AI co-pilot keeps its own SQL tool in the MCP gateway. - Through eaxCloud remote access a query is an engineer action.
- On Free and Starter, and after a downgrade or a licence expiry, the tab is not shown and the routes answer
403 EDITION. - Every query, refused and cancelled ones too, is recorded in the audit trail as
analytics.query(categoryanalytics): the SHA-256 of the SQL text (the full text goes to the server log), the parameters, the rows, the result’s hash and the duration. One record per identical query per user per minute; the repeats are counted into the next record. A result whose record cannot be written is not given (503 AUDIT_NOT_WRITTEN).
Going further
Section titled “Going further”- Export a whole result, or a saved dataset, as CSV, Excel or Parquet: Export analytics results. Export CSV on the grid and the chart’s CSV export only the rows the browser holds.
- Query several sources together (the historian and the alarms), and pivot a large result on the server: Combine sources with extracts and pivot on the server.
Over the HTTP API
Section titled “Over the HTTP API”As a signed-in person with analytics (a browser session):
POST /api/analytics/queryContent-Type: application/json
{"family": "historian", "sql": "SELECT tag_path, avg(value) AS v, agg_quality(quality_class) AS quality_class FROM samples GROUP BY 1", "parameters": [{"name": "from", "type": "timestamp", "value": "2026-11-04T13:00:00Z"}, {"name": "to", "type": "timestamp", "value": "2026-11-04T16:00:00Z"}]}- The answer holds the result’s
id,columns,total_rows,truncated,sha256, the hidden tags’ count (tags_hidden), the quality summary (quality_column,qualitycounts,ignores_qualitywithquality_reasonandquality_fix,affected_rows) and the firstpage:rows,row_quality(each row’s class),row_affected(rows that may hold non-good samples),next_offset(-1after the last page). GET /api/analytics/query/<id>?offset=&limit=reads the next page (at most 10,000 rows);DELETE /api/analytics/query/<id>drops your result; another user’s result answers404.DELETE /api/analytics/querycancels your running query; the query itself then answers409 ANALYTICS_CANCELLED.tag_scope(tag patterns) can narrow the tags a query reads, never widen your rights.- An error in the SQL answers
422 REPORTS_SQLwithmessage,lineandcolumnin the text sent. GET /api/analytics/querieslists your saved queries, the limits and the sources;PUT /api/analytics/queries/<id>saves one ({"name", "family", "sql", "parameters"}),DELETEremoves it.
The answers are listed in the reference.