Getting Age field | Community
Skip to main content
May 23, 2024
Solved

Getting Age field

  • May 23, 2024
  • 1 reply
  • 999 views

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Mohan_Dugganab

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))

 

 

1 reply

Mohan_Dugganab
Adobe Employee
Mohan_DugganabAdobe EmployeeAccepted solution
Adobe Employee
May 23, 2024

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))

 

 

LaxaDeAuthor
May 24, 2024

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

Mohan_Dugganab
Adobe Employee
Adobe Employee
May 24, 2024

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-journey-building/update-profiles 

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