Computations: Create new user properties on the fly
US Region only
Amplitude supports computations in the US region only. Users in the EU data processing region can't use computations.
Like cohorts, computations are a segmentation tool. Cohorts create lists of users. Computations create computed user properties that you can use in segmentation and personalization workflows.
Use computations to:
- Transform an event or event property into a computed user property.
- Segment your users by the computed property as a configurable filter in any Amplitude chart.
- Sync the computed property to an external personalization destination.
For example, you might want to segment users by the number of purchases they’ve made. You could create a cohort for each possible purchase count, but that approach becomes cumbersome as the number of counts grows.
Instead, create a computed property such as number_of_orders. The computed property stores the purchase count as a single integer on each user. For this use case, a computed property gives you a more flexible segmentation option than a set of cohorts.
To use your computed property as a filter in a chart, first choose your computed property as a filter parameter in a cohort. Save the cohort. You can then select that cohort in any Amplitude chart as a segmentation parameter. You can also query directly on a computed property in a chart as a property filter or group-by option.
Grouping by computations works only on Event Segmentation, Funnel Analysis, Retention Analysis, and composition charts.
Computed properties work well for personalization campaigns. Amplitude supports three computed property types:
- Event count: Counts the number of times a user has fired an event over a defined period.
- Aggregation: Calculates the sum, minimum, maximum, or average of event property values over a defined period.
- First/last value: Uses only the first or last value of the selected property in charts.
Computations support standard, derived, and transformed event properties only.
Create a computed property
To create a new computed property, follow these steps:
- Navigate to Computations → Create Computation.
- Under Computation Type, select the type of computed property you want to create and click Next >.
- Under Select an Event, choose the event you’re interested in building your computed property from:
- For event count computed properties, you can filter the event using + where clauses to add conditions.
- For aggregation computed properties, select an event and the related event property you want to aggregate. Specify if you want to compute an average, minimum, maximum, or sum value.
- For first/last value computed properties, select the aggregation type First Value or Last Value. Specify the appropriate event and property.
Aggregation requires property values to be an integer.
- Set the time range for your computed property. When you’re done, click Next >.
- Name your computation and enter an optional description. This name appears as a user property on every user. Then click Next >.
- Review your results. The computation takes a few seconds to generate.
Amplitude Cohorts & Audiences applies the computation to all users who were active during your specified date range. The details view shows the computation configuration, a distribution of all users, event count distribution, and aggregation distribution by distinct binned values.
Delete a computation
You can delete a computation at any time after you create it. To delete a computation, follow these steps:
- Click Computations in the left-side rail.
- Click the name of the computation you wish to delete.
- From the More drop-down menu, click Delete.
- Confirm that you want to delete this computation.
When you delete a computation, it no longer appears as an available user property for your cohorts. You can't sync it or filter from it within your cohorts. Deleting unneeded computations frees space for new computations.
Use computed properties in campaigns with external destinations
Computed properties work well in personalization campaigns. Sync the computed property as a user property to external destinations, such as a database or third-party marketing platform.
For example, use a computed property to calculate the total number of orders a user has placed. Then use that information to trigger a different canvas in Braze when the number reaches a threshold. You can also calculate users’ average order values, sync them to the Profile API, and show different in-app interstitials based on those values.
Amplitude Activation supports Braze, S3, and the Profile API as destinations for computed property syncs. The process of syncing to Braze accrues more data points in your Braze plan, which may result in an additional charge from Braze.
To sync your computed property with a personalization tool, follow the instructions in Sync to third-party destinations.
Was this helpful?