Is it possible to calculate age from date of birth using Data Prep or inside a condition in a journey? | Community
Skip to main content
Level 2
April 12, 2023
Solved

Is it possible to calculate age from date of birth using Data Prep or inside a condition in a journey?

  • April 12, 2023
  • 4 replies
  • 3957 views

@1961013 , @danny-miller  There is a date of birth field in profile. The requirement is to create segments based on age. Is it possible to calculate the age from date of birth within AEP?

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 ChetanyaJain-1

@sindhe, the computed attributes feature (in beta currently) will be super helpful in your case.

https://experienceleague.adobe.com/docs/experience-platform/profile/computed-attributes/ca-api.html#:~:text=Computed%20attributes%20are%20functions%20used,segmentation%2C%20activation%2C%20and%20personalization.

 

You can define a field "age" at the profile level, define the computation, and leave it. 

4 replies

Anil_Umachigi
Adobe Employee
Adobe Employee
April 12, 2023

@sindhe Data prep may not be right option here, assuming this profile dataset is not ingested on daily basis. Data prep runs only during data ingestion. 

One way i would think of doing this is 

  1. set a ageAsOfToday field in the schema 
  2. Run a query service job (scheduled every night) which updates this field for all profiles. 
  3. Use this field in segment which will be evaluated everyday with accurate age info
SindheAuthor
Level 2
April 12, 2023

Doesn't this require Data Distiller license?

Anil_Umachigi
Adobe Employee
Adobe Employee
April 13, 2023

@sindhe Probably, depends on how your license is set up. 

Level 3
April 12, 2023

You can use data prep to calculate age but the this will not be recalculated unless you ingest the record again.
I would either, based on requirement, use Query Service or just create segments to qualify users in certain age groups

Danny-Miller
Adobe Employee
Adobe Employee
April 12, 2023

@sindhe Unless I'm missing something, if you have DOB, then the Segment uses Rolling Range to calculate age.

 

 

ChetanyaJain-1
Community Advisor
ChetanyaJain-1Community AdvisorAccepted solution
Community Advisor
April 12, 2023

@sindhe, the computed attributes feature (in beta currently) will be super helpful in your case.

https://experienceleague.adobe.com/docs/experience-platform/profile/computed-attributes/ca-api.html#:~:text=Computed%20attributes%20are%20functions%20used,segmentation%2C%20activation%2C%20and%20personalization.

 

You can define a field "age" at the profile level, define the computation, and leave it. 

sambhav-jain
Level 2
May 24, 2023

Hi Chetanya,

 

The page link you shared is not accessible now. Please share the update link.

ChetanyaJain-1
Community Advisor
Community Advisor
May 25, 2023

Hi @sambhav-jain, unfortunately, the page is taken offline. I believe this is a feature that is likely to be released in the future.