Let AI Assistant build your complex derived properties for you

  • 6 September 2023
  • 1 reply
  • 190 views

Userlevel 4
Badge +8

 

 

Have you ever needed assistance building a complex derived property?

I know I have. 

We all have unique property data in our organizations, so it’s tricky to document every possible use case in our derived property documentation.  

But don’t fret - Amplitude’s got you covered. Just when you think you’ve hit a complex limitation in setting up a derived property... try using our AI Assistant. 

AI Assistant

When you expand the Data modal to create a new derived property, you’ll notice a grayed-out CTA labeled ✨ Suggest. The more descriptive you type a prompt in the description field, the more accurate this Suggest feature will yield a correct derived property formula.  

New AI Assistant Suggest CTA is available when you type out a descriptive prompt in the Derived Property Description

 

Note: Customers who have purchased the Govern Add-on have access to derived properties. 

 

Internal use case

Amplitude recently put the AI Assistant to work to build out a new complex derived property internally. We needed a way to display inventory URLs to quickly copy and paste into a browser. This is a common request from our customers who inquire which inventory URLs are most commonly engaged with.  

The common URL string to load existing saved inventory within an org is the following: https://app.amplitude.com/analytics/{org_url}/{inventory_type}/{inventory_id}

 

Underlying data

Within our internal instrumentation of Amplitude, we track an event property labeled inventory id which is comprised of 2 components separated by an underscore: inventory type and inventory id. Sample values below:

  • dashboard_3ll8z0u
  • notebook_e8hmz8p
  • chart_fhj84m2g
  • cohort_5xlyt3t

We also track every user’s org url as a user property in a string datatype. Sample values below:

  • demo
  • gtm-demo
  • amplitude

We needed to yield the following sample url syntax with our new derived property inventory urlhttps://app.amplitude.com/analytics/demo/dashboard/3ll8z0u. This syntax is a combination of a static string, concatenated with a user property and an event property, and we also needed to replace the regex of “_” with “/” within the event property. 

 

Descriptive prompt

We wrote out the following prompt in the description field:

Concatenate 'https://app.amplitude.com/analytics/' string with user property 'org url', then add '/', then concatenate with event property 'inventory id' after replacing '_' with '/' in 'inventory id'

 

Then we clicked the ✨ Suggest CTA.

Pro Tip: The more descriptive you are, the better the results

 

Derived property formula

Amplitude’s AI Assistant generated the following output for our derived property use case:

CONCAT(
'https://app.amplitude.com/analytics/',
{org url},
'/',
REGEXREPLACE(
{inventory id},
'_',
'/'
)
)

 

Formula validation

First we verified the correct user property and event property were specified in the formula. This is critical if you have redundant properties set as event, user, and group props. 

Then we tested some sample org url values along with the org’s respective inventory id values to verify that the newly created derived property inventory url outputted the correct value. 

Preview outcomes from a new derived property to verify the value outputted displays as expected

 

Sample inventory urls outputted from this new derived property within the demo org:

 

This QA session concluded with accurate results from our newly created derived property. 

Comment below if you have any questions on how to use this new feature, or if you found this helpful. Thanks! 


1 reply

Userlevel 5
Badge +9

Can see this being very useful, thanks for sharing @JennRu!

Reply