Derived properties

Derived properties create new event and user properties retroactively from existing ones, using functions and operators. Amplitude computes them dynamically at query time and doesn't change your raw data. Use them to run analyses on values you didn't send in the original event payload.

Use a derived property when you need a value computed from existing properties and don't want to re-instrument or re-ingest data. If you need a value sent at event time from the client, use a regular event property instead. If you need a curated, named event built from multiple raw events, use a custom event instead.

For example, create a derived property whose value is a boolean based on whether a cart item's price exceeds a threshold.

Create a derived property

You need to be on your project's main branch to create a derived property.

To create a derived property, follow these steps:

  1. In Amplitude Data, go to Tracking Plan > Properties and select the Derived Properties tab.
  2. Select Add Derived Property.
  3. Give your derived property a name.
  4. Add any relevant metadata to your property, including a description (optional, unless you want to use the Suggest feature) and the visibility of the property in charts within this project.
  5. Enter your formula. Review the list of valid functions and operators below.
  6. Select Save.

Preview your results

As long as the formula you entered is valid, you can test the results in the space below the formula editor. Test by selecting existing values for properties used in the formula, or by entering free-form values. You can test from either the Create/Edit modal or from the side panel for a saved derived property.

Derived property use cases

Using the referrer URL example, you can write a formula using string operators such as:

SPLIT(PROPERTY('referrer_url','event'), "/", 2)

This formula converts a value like "https://www.google.com/search?q=amplitude" into the value "www.google.com." To strip this down further to "google", wrap the result of a SPLIT function inside another SPLIT function. The resulting formula looks like this:

SPLIT(SPLIT(PROPERTY('referrer_url','event'), "/", 2), ".", 1)

Amplitude also supports math operators. For example, if you have events that contain subtotal and tip properties and want to run analyses based on the total amount, use this formula:

SUM(PROPERTY('subtotal','event'), PROPERTY('tip','event'))

To determine whether a particular order receives a discount when the total order size exceeds $50, use this formula:

IF(SUM(PROPERTY('subtotal','event'), PROPERTY('tip','event')) >= 50, 'true')

Queries using derived properties might experience longer query times depending on the complexity of the formulas. A limit of up to 10 property references per derived property also applies.

Reference

Was this helpful?

For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.

On this page