Expand my Community achievements bar.

Adobe Journey Optimizer Community Lens 6th edition is out.

Getting Age field

Avatar

Level 1

Hi,

Using Arithmetic function to calculate the age from Date of Birth field we are getting the below error.

How can we get the age calculated in AJO? attaching the screen shot of the error

 

 

3 Replies

Avatar

Employee

You can use the following snippet as a reference 

 

((((toInteger(substr(toString(now()),0,4))) - 
(toInteger(substr((#{ExperiencePlatform.ProfileFieldGroup.profile._tenant.personExtn.birthDateStr}),0,4)))) <= 40))
and
((((toInteger(substr(toString(now()),0,4))) - 
(toInteger(substr((#{ExperiencePlatform.ProfileFieldGroup.profile._tenant.personExtn.birthDateStr}),0,4)))) >= 18))

 

 

Avatar

Level 1

@dugganab Thanks for the reply. can we get the age value so it can be exported externally?

Avatar

Employee

You can actually write the value of this expression using update profile activity into one of the existing attributes on profile (say age) and then use it for exports 

 

Kindly take a note of the below - https://experienceleague.adobe.com/en/docs/journey-optimizer/using/orchestrate-journeys/about-journe... 

dugganab_0-1716536268034.png

If you would like this to be handled as part of data load itself, you may want to explore data prep functionality https://experienceleague.adobe.com/en/docs/experience-platform/data-prep/home