Calculated Fields
Calculated fields enable you to compute fields that do not exist in your current model. That gives you more flexibility for your segmentations.
Let's give an example! When building a specific audience, you may need derived or computed attributes instead of raw data. For instance, if you want to segment users based on their average basket value but don’t have a dedicated column in your Users table, you need to calculate it by summing each user's total purchase value and dividing it by their number of purchases.
What is a Calculated Field?
A calculated field is a new attribute that users can create directly in DinMo without modifying their original data source. This feature allows you to generate new fields based on your existing data, making it easier to build advanced audiences and sync enriched customer profiles to your destinations.
We have built a no-code interface to enable you to compute these attributes based on your tables. Once created, calculated fields behave like any other field in the schema, meaning they can be used in segment filters, mappings, and syncs.
Examples of Calculated fields
Imagine a user wants to sync conversion data to a CRM, but their transactions table does not contain an LTV column but only transactions. Instead of modifying the original table, the user can create a calculated field in DinMo, setting an LTV field that is the sum of all purchases for a given customer.
These fields can then be used as filters on the segment builder and be included in mappings during data sync.
How to create a Calculated Field
Click on the model for which you wish to compute a calculated field, and go to the Calculated Field tab.

Click on New Calculated Field. You will then have 2 possible options:
Aggregated field: Field aggregating data from a linked model (for example, the sum of all revenues for a given customer).
Formula field: Field obtained after an operation on several existing fields. For example, you can obtain the predicted total LTV by summing the revenues already generated and the predicted additional value.
How to compute aggregated field
If you want to calculate an aggregated field, click on the appropriate button. A panel will open where you will need to fill in the following fields:

Related Model: Select the model related to your base model. This should be a model that follows a "Has Many" relationship to your base model. For example, if you are calculating data for a customer, you could relate it to a "Purchases" model that contains the transaction data for each customer.
[Optional] Any filter to the calculation method.
Calculation Type: You will be presented with several calculation options depending on the type of data you want to aggregate. Choose from the following:
Average: Mean value of a numeric column (numeric).
Count: Number of records matching specific criteria (any type).
Distinct Count: Number of distinct records matching specific criteria (any type).
List aggregation: Aggregated list of values matching specific criteria, per customer (any type).
Maximum: Largest value in a column (numeric).
Minimum: Smallest value in a column (numeric).
Most Frequent (Mode): Most frequently occurring value for a customer (any type).
Sum: Total of a numeric column (numeric).
Model Field: After selecting the related model and the calculation type, you will see a list of available fields that match the calculation type you selected. Choose the appropriate field that aligns with your calculation needs. For
SUM, for instance, you need to select which column to sum.
Once you’ve entered all the necessary information, click on Preview and Continue. You will be presented with a summary of your calculated field.

You can then:
Give your calculated field a name
Give your calculated field a description
Decide whether or not to materialize your calculated field
Make your calculated field categorical or not
How to compute formula field
If you want to calculate a formula field, click on the appropriate button. A panel will open where you will need to fill different sections:

The name of your calculated field
The type of the field you wish to calculate (string, number or boolean)
The formula of your calculated field. Depending on the type of field you are trying to calculate, you will be offered different options. For instance, for number, you can use any existing numeric/decimal field, classical mathematical operators (+,-,*,/) and numbers to transcribe your formula. You can also use an operator to calculate the number of days between several dates.
Once you’ve entered all the necessary information, click on Preview and Save. Your calculated field will be updated automatically each time the field is used (in a preview, when calculating a segment, during activation, etc.).
Labeling
Labelling option is a useful way to create friendly options for case/when statements.
For example, imagine you want to bucket customers into low, medium, and high risk of churn.
You can do this with the following formula field:

Choosing whether or not to materialize your calculated field
In DinMo you can choose whether your calculated fields are live (computed on demand) or materialized (pre-computed and stored) — just as you do for models.
A materialized calculated field stores query results as a physical table in your data warehouse (e.g., BigQuery, Snowflake) — storing all calculated fields that are already materialized
A live (=non-materialized) calculated field remains a logical view — it is queried in real time each time it’s used.
Materializing a calculated field offers faster query performance and stable snapshots for downstream usage, but you lose the benefit of instant freshness. If you keep the calculated field live while the model is materialized, you ensure that the field always reflects the most recent data as soon as the model table is updated.
If your model is already materialized (i.e., stored in your warehouse on a refresh schedule), you may still keep calculated fields live. However, if you decide to materialize the calculated field as well, it must share the same refresh schedule as the underlying model.
How to use calculated fields
Once your calculated field is set up, you will be able to preview it directly on the same tab.
Different icons are used depending on whether the calculated field is based on a formula or is aggregated.


You can now use this field as a filter on the segment builder.
Last updated