Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate age from date of birth

Hi,


I Woud like to calculate the age of employees (from the current date). What load script should I use to create a new field Age?

[Employees off]:

Directory;

LOAD *,

  DATE(DATE([Date of Birth], 'D-MM-YYY'), 'DD-MMM-YY') as Birthday,

  FROM

Datasources\EmpOff.xls

(biff, embedded labels, table is Employee$);

Thank you in advance.

Kind Regards

5 Replies
its_anandrjs

Hi,

Work on the date functions for this that will help you and create the another table resident of the current, you can find the many post related to this will help you.

Regards

Anand

hic
Former Employee
Former Employee

[Employees off]:

Load *,

   Age(Today(), [Birthday]) as Age;

LOAD *,

  DATE(DATE#([Date of Birth], 'D-MM-YYY'), 'DD-MMM-YY') as Birthday

  FROM

Datasources\EmpOff.xls

(biff, embedded labels, table is Employee$);

its_anandrjs

You can also use

Interval( Today(), [Birthday], 'YY' ) as Diff

Regards

Anand

Anonymous
Not applicable
Author

You can use

Age(today(),[Date of Birth])

renato_gerber
Partner - Contributor II
Partner - Contributor II

The Function age() works fine.

My blog and wiki is https://qlikblog.ch