Skip to main content
Calculated fields add custom logic to a data source: calculated columns, calculated metrics, and calculated URLs. SQL must match the source database dialect — PostgreSQL, ClickHouse, or BigQuery. For worked expressions, Real-Time metadata syntax, and examples, see Calculated columns, metrics, and URLs.
Editing a calculated column, metric, or URL affects all dashboards portfolio-wide. Always validate logic before you apply changes. Native columns cannot be edited. They are the building blocks that calculations reference.

Add a calculated field

You can create a calculated field from Building BI Data Sources or from a chart in the dashboard editor. Both paths open the same Add Column form.
Open Data Sources from the bottom of the Building BI left navigation tray. Do not use the Cloud BMS Data Sources button. That page manages connectors, not Building BI tables. See Data source types.

From Data Sources

1

Open Building BI Data Sources

In Building BI, select Data Sources at the bottom of the left navigation tray.
2

Open the data source

Select the data source you want to extend.
3

Start a new field

Select + Add Column in the upper right of the schema view.
4

Complete the field details

Choose the field type, then set name, display name, description, data type, and SQL expression. Optionally enable Hidden or Sensitive Values on the field.
Add Column dialog with Calculated selected, Name and Display Name fields, Description, Data Type dropdown, SQL Expression editor, and Create button

Add Column form for a calculated field on a Building BI data source

For schema tabs, samples, and SQL examples, see Data sources.

From the chart editor

While editing a chart, open Chart Parameters Setup and select + Add Column (or the + control next to a field group such as Metrics). The same portfolio-wide field form opens.
Building BI dashboard editor with Chart Parameters Setup open, showing Metrics with formula indicators and the control to add a new calculated field

Adding a calculated field from Chart Parameters Setup while editing a dashboard

You cannot edit an existing calculated field’s SQL from the chart fx popup. Open the field from Data Sources to change the expression. See Chart setup parameters.

Calculated columns

Calculated columns work like spreadsheet formulas. They apply logic to each row using only that row’s data. Common patterns include extracting time parts (for example, toHour(date_time_local)) and isolating one sensor with conditional logic. Use exact database column names (for example, building_name, not "Building Name"). See Point time series column reference. On Point Time Series Real-Time (ClickHouse), wrap metadata fields such as building_name, device_name, or ontology_point_field in dictGetString(...). Last Value tables do not need the wrapper. Copy-ready Real-Time and Last Value examples are in Data sources. For why the tables differ, see Real-Time vs Last Value.

Calculated metrics

Calculated metrics aggregate across multiple rows. The output recalculates based on the chart’s grouping (for example, per hour or per device). You can filter inside the expression (for example, sumIf) or keep the metric simple and filter on the chart. See Filter options and worked examples in Data sources. As an alternative to a chart filter, put the condition in a single metric. For example:
That metric returns the average only for matching rows. You do not need a separate chart filter for that device. Set a data type on every calculated metric. Non-Number metrics change where you can use the field:

Calculated URLs

Calculated URLs turn row data into navigation actions. To apply a URL on a table column, open the widget Style settings. Set the column’s URL option (for example, Device URL) so each cell becomes a hyperlink to that record’s page. See Widget customization. Returned URL columns appear in the response prefixed with INTERNAL_URL:: (for example, INTERNAL_URL::building_url::building_name).

URLs on chart widgets

You can assign a single URL column (urlColumn) to a dimension, breakdown dimension, hierarchy item, or the Time-series Key column. On charts with a URL applied, right-click a data point to open a context menu. The menu offers navigation to the linked Cloud BMS record (Building, Area, Device, and similar) and cross-filtering. Supported on Tables (Raw, Aggregated, Pivot), Bar (all), Line (all, at marker points), Pie, Sunburst, Heat-map, Tree-map, Scatter, Boxplot, Sankey (nodes only), Polar Bar (all), and Time-series. Chart definitions are in Chart types.

Columns vs metrics

Calculated URLs create links. Columns and metrics are easier to confuse: columns run once per row; metrics aggregate across rows. The graphic below shows a calculated column that labels comfort on every row from that row’s temperature.
Graphic showing a calculated column Temp Comfort that labels each discharge air temperature row as Too Cold, Comfortable, or Too Hot using per-row CASE logic

A calculated column evaluates each row and writes a result for that row

A calculated metric instead collapses many rows into one aggregated value for the chart.
Graphic showing a calculated metric that averages temperature values for AHU 2 filtered on the dashboard, producing a single card value of 69.5 degrees Fahrenheit

A calculated metric aggregates matching rows into one chart value

Database and syntax

Calculated field limitations

Calculated columns and metrics in Building BI do not support:
  • Window functions
  • Aggregations of aggregations
This is a calculated field limit, not a ClickHouse limit. ClickHouse virtual table SQL can use window functions. Put the logic in a virtual table when you need window functions or aggregations of aggregations.

See also

Next steps

Data sources

Write calculated field SQL, including Real-Time metadata syntax and worked examples.

Chart types

See which charts accept metrics, columns, and URL navigation.

Physical vs virtual data sources

Compare direct tables with derived virtual sources.

Key data sources

Choose Real-Time or Last Value Point Time Series sources.

Database types

Understand ClickHouse, PostgreSQL, and BigQuery trade-offs.

Column reference

Look up column names for calculations and filters.
Last modified on August 18, 2026