Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
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'))
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'))
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;
hi
pfa
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;
may be this, remove single quotation?
AgeTable:
Load *,
age('19/01/2016', DateOfBirth) As Age
Resident Employees;
Drop table Employees;
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)
With age() it would not be possible as it return only year difference
hi Balraj,
There is any other way(other function) to calculate complete date format
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;
EDIT: With reference from Age Calculation | Qlik Community