Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

[resolved] How to get age from date of birth

Hi all,
How to calculate the age of a person from his date of birth

My table contains


Sno  Fname    DOB(numeric)


1      Shan       29081990


2      Hani        17071989


My output has to be


Srno  Fname  Age(varchar)


1         Shan        24


2         Hani         25


can some one help me to guide how to solve this


Regards,


Nare

Labels (2)
1 Solution

Accepted Solutions
Jcs19
Creator II
Creator II

If you dont know java language
You can use tmap and create Variables 
transform your DOB(numeric) to a date with dateparse
then use datediff
check below
0683p000009MEaF.png
(care its Var.Fulldate not Var.fulldate, i made an error on the screenshoot)
tell me if you dont understand ! (I transform your interger to string, then your string to date)
If you get a negative number, then try TalendDate.diffDate(TalendDate.getCurrentDate(), Var.FullDate,"yyyy")  

View solution in original post

2 Replies
Anonymous
Not applicable

Jcs19
Creator II
Creator II

If you dont know java language
You can use tmap and create Variables 
transform your DOB(numeric) to a date with dateparse
then use datediff
check below
0683p000009MEaF.png
(care its Var.Fulldate not Var.fulldate, i made an error on the screenshoot)
tell me if you dont understand ! (I transform your interger to string, then your string to date)
If you get a negative number, then try TalendDate.diffDate(TalendDate.getCurrentDate(), Var.FullDate,"yyyy")