LemuAIDocs

Segments · 2 min read · For everyone

Calculated fields

Work out one figure per contact from their events or records, like orders in the last 90 days or total spent, and use it in segments, messages and journeys.

Open in ChatGPTOpen in ClaudeMarkdown

A calculated field is a number or date LemuAI works out for every contact, for example "orders in the last 60 days", "total spent", "average order value" or "last order date". It's stored on the contact like any other field, so you can use it in:

  • segment rules (Contact property → the field, marked "(calculated)"),
  • message templates ({{ contact.metrics.total_spent_60d }}),
  • journeys and the contact page.

They're under Audience → Segments → Calculated fields.

Create one#

  1. Name and key

    Name (like Total spent in the last 60 days) and Key (like total_spent_60d). The key is fixed once created, because templates use it.

  2. Choose what to calculate from

    From events (a contact's events, like Purchase) or From records (a record type, like orders or loans).

  3. Choose the calculation

    From eventsFrom records
    Number of timesNumber of records
    Total of a propertyTotal of a field
    Average of a propertyAverage of a field
    Smallest value of a propertySmallest value of a field
    Largest value of a propertyLargest value of a field
    Number of different values of a propertyNumber of different values of a field
    Date of the first time
    Date of the most recent time

    Pick the event (or record type), the property or field (for events, type a property name like value, order.total or items.quantity), and a time window if you want one.

  4. Preview and create

    Preview shows sample values. Create field: values are calculated in a few minutes.

How values update#

  • Recalculated every hour, when you save the field, and when you press Recalculate now.
  • Only contacts with something to show get a value. A count or total of 0 is left empty; segments treat an empty count or total as 0.
  • Deleting a field removes its values from every contact; messages that use it show nothing in its place.

Examples#

NameFromCalculation
Orders in the last 90 daysEvents: PurchaseNumber of times, last 90 days
Total spentEvents: PurchaseTotal of a property: value
Last order dateEvents: PurchaseDate of the most recent time
Loans outstandingRecords: loans (filter status is active)Number of records
Different categories boughtEvents: PurchaseNumber of different values of a property: items.category

Then a segment "Total spent is at least 10000 and Orders in the last 90 days is 0" finds big spenders who stopped buying.

Was this page helpful?