The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

How to compute age from Birthdate

Hayashi87Hayashi87 Member Posts: 4 Contributor I
edited November 2018 in Help

I have a birthdate field in dd/mm/yyyy? How do you compute age using Generate Attributes?

Answers

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    date_diff(date_now(),birthday)/(1000*60*60*24*365.25)

  • Hayashi87Hayashi87 Member Posts: 4 Contributor I

    Thanks Thomas, any idea why I am getting negative values and decimal in my age field?

  • Thomas_OttThomas_Ott RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,761 Unicorn

    Try '(Birthday,date_now())' instead. I went off my faulty memory, check the date_diff() function requirements. 

Sign In or Register to comment.