Expand my Community achievements bar.

SOLVED

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

Avatar

Level 2

@Saurav , @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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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#....

 

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

View solution in original post

8 Replies

Avatar

Community Advisor

@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

Avatar

Community Advisor

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

Avatar

Level 3

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

Avatar

Employee Advisor

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

DannyMiller_0-1681317040962.png

 

 

Avatar

Correct answer by
Community Advisor

@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#....

 

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

Avatar

Level 3

Hi Chetanya,

 

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

Avatar

Community Advisor

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