Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to calculate age in between the dates?

Hii,

can you anyone help to calculate the age in between dates in script.

-> actually i tried this '  SET VDATE=TODAY(); in main script'

-> next calculate the age like ' ($(VDATE)-DOB) AS AGE'

Is this correct query or not.

thanks in advance,

Hita

3 Replies
fashid
Specialist
Specialist

Hi,

THIS WILL ONLY GIVE YOU A DATE AGAIN YOU WILL HAVE TO USE YEAR FUNCTIONS AND THEN CALCULATE NO OF YEARS BETWEEN THE  TWO DATES.

check this discussion maybe it will help

Calculate Age in Qlikview

Regards,

Nadeem

jagadeesh_diamo
Contributor III
Contributor III

Hi,

Try this

Ceil((Today()-MakeDate(DOB))/365)  as Age

EX:

Ceil((Today()-MakeDate(2000,01,01))/365)  as Age

Round((Today()-MakeDate(2000,01,01))/365)  as Age

You can use Variable instead of makedate if more records are there.

Thanks.

MarcoWedel

Use the Age() function.