Calculated fields are currently available as query-level fields in
Semantic Query tabs and Explore. Support for additional field types is
planned for a future release.
When to use calculated fields
Use calculated fields when you need to:- Compute a ratio, percentage, or difference between existing measures
- Derive a new dimension from existing dimensions (for example, concatenating first and last name)
- Test a metric definition before adding it to the data model
- Create one-off calculations for a specific analysis without involving a data engineer
Creating a calculated field
Open a Semantic Query tab or Explore
In a workbook, open an existing Semantic Query tab or create a new one. You
can also start from the Explore page.
Add a calculated field
In the left pane, click the + button next to the measures or dimensions
section and select Calculated field.
Write the expression
Enter a SQL expression that references existing measures or dimensions from
the current view. For example, to calculate a completion rate:You can use standard SQL functions and operators supported by your data
source.
Name the field
Give the calculated field a descriptive name. This name appears in the
results table and any visualizations you build.
Expression syntax
Calculated field expressions use SQL syntax. You can reference any measure or dimension available in the current semantic view by name.Supported operations
| Operation | Example |
|---|---|
| Arithmetic | revenue - cost |
| Division with decimals | 1.0 * completed_count / total_count |
| String concatenation | first_name || ' ' || last_name |
| Conditional logic | CASE WHEN status = 'active' THEN 1 ELSE 0 END |
| SQL functions | ROUND(revenue / orders, 2) |
Calculated field scope
Calculated fields are scoped to the individual query where they are created. They are:- Not saved to the data model — they exist only within the workbook tab or Explore session where you created them
- Saved with the workbook — if you save or publish the workbook, your calculated fields are preserved in that workbook
- Not available in other workbooks — to share a metric across workbooks, add it to the data model as a calculated measure
Limitations
- Calculated fields are available in Semantic Query tabs and Explore only, not in Source SQL tabs
- Pre-aggregations do not apply to calculated fields since they are not part of the data model
- Access control policies defined in the data model do not apply to calculated field expressions directly, though the underlying measures and dimensions they reference still respect access control
Related resources
- Calculated measures and dimensions for defining reusable calculations in the data model
- Querying data for working with Semantic Query tabs
- Explore for ad-hoc data exploration