Skip to main content
The latest aggregation type selects the most recent value of a specified event property from all received events.
Diagram of the LATEST aggregation, keeping the value of the most recent event

LATEST calculation method

LATEST billable metric

Here is how you can create a latest aggregation from the UI:
  1. Access the “Billable metrics” section via the side menu;
  2. Create a new billable metric;
  3. Define a name, a code and an optional description;
  4. Select “latest” as the aggregation type;
  5. Define the property to aggregate;
  6. Apply filters if any; and
  7. Click “Add billable metric”.
This billable metric is metered only, meaning it cannot be recurring, and the number of billing units resets to 0 at the end of each period.

Calculation example

Lago calculates the LAST_VALUE(events.properties.property_name) OVER (ORDER BY events.timestamp) for the two following events received.
In that case, with this aggregation type, Lago takes the latest value of the total_requests property from all events, resulting in a billable value of 10 units.