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

age is not display

Hi all

Employees:

LOAD * INLINE [

Member,DateOfBirth

John,28/03/1989

Linda,10/12/1990

Steve,5/2/1992

Birg,31/3/1993

Raj,19/5/1994

Prita,15/9/1994

Su,11/12/1994

Goran,2/3/1995

Sunny,14/5/1996

Ajoa,13/6/1996

Daphne,7/7/1998

Biffy,4/8/2000

];

AgeTable:

Load *,

age('19/01/2016', DateOfBirth) As Age

Resident Employees;

Drop table Employees;

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Qkukview maynot recognoize the date format

try to define it yourself

I succeeded with this expression

age(date#('19/01/2016','DD/MM/YYYY'),date#(DateofBirth'DD/MM/YYYY'))

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Qkukview maynot recognoize the date format

try to define it yourself

I succeeded with this expression

age(date#('19/01/2016','DD/MM/YYYY'),date#(DateofBirth'DD/MM/YYYY'))

sunny_talwar

Try this:

SET DateFormat='DD/MM/YYYY';

Employees:

LOAD * INLINE [

Member,DateOfBirth

John,28/03/1989

Linda,10/12/1990

Steve,5/2/1992

Birg,31/3/1993

Raj,19/5/1994

Prita,15/9/1994

Su,11/12/1994

Goran,2/3/1995

Sunny,14/5/1996

Ajoa,13/6/1996

Daphne,7/7/1998

Biffy,4/8/2000

];

AgeTable:

Load *,

  Age('19/01/2016', DateOfBirth) As Age

Resident Employees;

Drop table Employees;


Capture.PNG

Chanty4u
MVP
MVP

hi

pfa

marcus_sommer

You will need something like this:date(date#(DateOfBirth, 'DD/MM/YYYY'), 'DD/MM/YYYY') and maybe the same with today:

AgeTable:

Load *,

age(date(today(), 'DD/MM/YYYY'), date(date#(DateOfBirth, 'DD/MM/YYYY'), 'DD/MM/YYYY')) As Age

Resident Employees;

Drop table Employees;

Anonymous
Not applicable
Author

may be this, remove single quotation?

AgeTable:

Load *,

age('19/01/2016', DateOfBirth) As Age

Resident Employees;

Drop table Employees;

Not applicable
Author

hi sunny thnx you for repaly,

Age('19/01/2016', DateOfBirth) As Age

it display only year


Is possible to display complete age (dd-mm-yy)



Anonymous
Not applicable
Author

With age() it would not be possible as it return only year difference

Not applicable
Author

hi Balraj,

There is any other way(other function) to calculate complete date format

sunny_talwar

May be this:

SET DateFormat='DD/MM/YYYY';

Employees:

LOAD * INLINE [

Member,DateOfBirth

John,28/03/1989

Linda,10/12/1990

Steve,5/2/1992

Birg,31/3/1993

Raj,19/5/1994

Prita,15/9/1994

Su,11/12/1994

Goran,2/3/1995

Sunny,14/5/1996

Ajoa,13/6/1996

Daphne,7/7/1998

Biffy,4/8/2000

];

AgeTable:

Load *,

  Age('19/01/2016', DateOfBirth) As Age,

  TimeStamp('19/01/2016' - DateOfBirth, 'YY') as Years,

  TimeStamp('19/01/2016' - DateOfBirth, 'MM') as Months,

  TimeStamp('19/01/2016' - DateOfBirth, 'DD') as Days

Resident Employees;

Drop table Employees;


Capture.PNG


EDIT: With reference from Age Calculation | Qlik Community