Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
anilet123
Partner - Contributor III
Partner - Contributor III

Age() Function not working in qliksense. Can anyone help on this ?

Age() Function not working in qliksense. Can anyone help on this ?

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Age() is the difference in years. The difference between Collection_Date and Bill_Date is less than 1 year, so Age = 0 is correct.

I suspect you are looking for age in days. Just subtract the dates - choose one of the expressions below according to your requirements.

     =Collection_Date - Bill_Date

     =Interval(Collection_Date - Bill_Date, 'd')

     =Floor(Collection_Date - Bill_Date)

     =Interval(Floor(Collection_Date - Bill_Date), 'd')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

6 Replies
jerryyang756
Creator
Creator

My code is working fine. Try to type it manually .when i copy and pasted from qlik help site example it was not working so i typed it manually and it working fine

=AGE('12/12/2013','06/07/1989')

here is my output

Capture.PNG

Capture2.PNG

anilet123
Partner - Contributor III
Partner - Contributor III
Author

Hi Pritam,

Thanks for the update. I am using QlikSense desktop version November 2017 Patch 2.

I tried using the function in load script as well as in UI both dint work for me. I do not want to hard code the value instead want to calculate based on fields End_Date and Start_Date.

Age() is a beautiful function in qlikview. I hope Qlik fixes this issue in QlikSense asap.

Regards,

Anilet Nirmal

pradosh_thakur
Master II
Master II

what are the date format in both the date ? any sample you can provide?

Learning never stops.
anilet123
Partner - Contributor III
Partner - Contributor III
Author

Please find the data exported from qliksense chart. Date format is 'M/D/YYYY'.

Function used is Age(Collection_Date,Bill_Date)

Capture.PNG

jonathandienst
Partner - Champion III
Partner - Champion III

Age() is the difference in years. The difference between Collection_Date and Bill_Date is less than 1 year, so Age = 0 is correct.

I suspect you are looking for age in days. Just subtract the dates - choose one of the expressions below according to your requirements.

     =Collection_Date - Bill_Date

     =Interval(Collection_Date - Bill_Date, 'd')

     =Floor(Collection_Date - Bill_Date)

     =Interval(Floor(Collection_Date - Bill_Date), 'd')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
anilet123
Partner - Contributor III
Partner - Contributor III
Author

An eye opener .. Thank you Jonathan.

I assumed its a bug in QlikSense. I was wrong.

Regards,

Anilet Nirmal