What is a Calculated Field?
Calculated fields (also called Derived Columns) let you create new data properties by applying functions, math, or logic to existing fields—similar to spreadsheet formulas. Use Calculated Fields to:- Simplify complex data to make event details more readable
- Track business measures that change over time
- Align disparate datasets
How Calculated Fields Work
In Honeycomb, Calculated Fields behave like any other field in your data and can be used in queries, boards, and alerts, depending on the scope. To learn more about syntax and available functions, visit Calculated Field Formula Reference.Choosing the Scope
In Honeycomb, you can create calculated fields that are tied to a query session or save calculated fields for use across Honeycomb resources.Calculated Fields Scoped to a Query
By default, calculated fields created through the Query Builder are scoped to your query, which means you can find the field again by name as long as you’re in the same query session. This helps reduce dataset bloat and makes it easier to iterate quickly without needing to manage one-off or exploratory formulas long-term. Use query-scoped calculated fields when you:- Need a one-off calculation for an investigation or exploratory query
- Want to avoid cluttering your dataset with fields you’ll only use once
- Are iterating rapidly and don’t want to manage permanent schema changes
Saved Calculated Fields
You can also save calculated fields to either a specific dataset or an entire environment:- When a calculation is relevant to only a specific dataset or service, use a dataset-specific calculated field.
- When a calculation needs to be shared across multiple datasets and services, use an environment-wide calculated field.
Use Cases for Calculated Fields
To understand how you can use calculated fields in practical situations, explore these example scenarios.Comparing Values
For advanced comparisons, calculated fields enable you to transform or categorize data dynamically, which not only simplifies data exploration but also ensures consistency in how comparisons are made across different investigations.Use a calculated field to compare valuesScenario:Your team manages a web server that handles requests with varying sizes of content.
Querying in Honeycomb with the GROUP BY clause set to 
content_length returns a time series graph that displays the count for each value of content_length.You want to compare small requests to all other requests.
Your team internally categorizes a small request as having a content_length of less than or equal to 1000.Solution:Create a calculated field named smallRequest as a boolean with the function LTE($content_length, 1000).Build a query with the GROUP BY clause set to smallRequest.
Your query will return a time series graph that displays the small requests alongside the other requests.
Standardizing Fields Across Multiple Datasets
Calculated fields let you standardize data across multiple datasets by defining consistent field names and expressions, which ensures queries return comparable results even when services implement fields differently. This enables seamless cross-dataset analysis within an environment.Standardize a field across multiple datasetsScenario:Your organization has three different services running in production: Payment, Checkout, and Support.
You want to get the total amount of purchases in USD from each service, but the services are implemented differently.Solution:In Honeycomb, create an environment named
Because a calculated field named
Production.
Inside your environment, send the data from each service to a different dataset: PaymentService, CheckoutService, and SupportService.Inside each dataset, create a calculated field with the alias total_amount_in_usd and construct it using an appropriate expression.
For example:| Dataset Name | Calculated Field Name | Calculated Field Expression |
|---|---|---|
PaymentService | total_amount_in_usd | COALESCE($usd_total, ADD(MUL($tax_rate, $item_total), $fees)) |
CheckoutService | total_amount_in_usd | MUL($cart_total, $tax_rate) |
SupportService | total_amount_in_usd | SUM(0) |
total_amount_in_usd now exists in a dataset, you cannot create an environment-wide calculated field with the same name.
Name any environment-wide calculated fields something unique to your environment, or change your instrumentation to rename the calculated fields in the datasets.Creating Calculated Fields
You can create calculated fields in Honeycomb’s UI through:- the Query Builder
- the Dataset’s schema for dataset-specific calculated fields
- the environment’s schema for environment-wide calculate fields
- Query Builder
- Dataset Schema
- Environment Schema
- Log in to the Honeycomb UI.
- In the navigation menu, select Query.
- From the New Query in dropdown, choose the dataset or environment you want to query.
- Select either the VISUALIZE, WHERE, or GROUP BY clause.
-
From the list of suggested fields, choose Create Calculated Field.

-
In the modal, enter details:
Field Description Save toggle switch Controls where the query is saved. Save to the query session only [off], or save to the selected dataset or environment [on]. Display Name Name that appears in the Query Builder. Enter a name that is unique across all datasets and the containing environment. Although Honeycomb tries to prevent duplicate field names, they can still occur. For help resolving naming conflicts, visit Common Issues with Queries: Calculated Fields. Description Description of your field. Use a maximum of 255 characters. Prompt (beta) Use natural language to generate a Calculated Field. For example, return "slow" if $duration_ms > 1000. Be sure to explicitly reference any schema fields using the field_name`). For help resolving errors, visit Common Issues with Queries: Calculated Fields.Editor Formula that defines your field. For syntax, available functions, and example formulas, visit Calculated Field Formula Reference. - Select Use in New Query.
Managing Calculated Fields
Once created, edit query-scoped calculated fields in a clause by selecting their Edit icon (). Saved calculated fields are part of the schema for a dataset or environment and must be managed within the settings for those areas. To modify a saved calculated field, access the configuration associated with its scope:- For dataset-specific calculated fields, visit Manage Dataset Calculated Fields.
- For environment-wide calculated fields, visit Manage Environment Calculated Fields.
Troubleshooting
For guidance when troubleshooting calculated fields in Honeycomb, visit Common Issues with Queries.Related Topics
- Organizing Data: Best Practices - Datasets or Environments