Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
krishnacbe
Partner - Specialist III
Partner - Specialist III

Age() function

Hi

I have a date field(ClaimDate). I need to calculate the age of claims. I have acheived it by using below expression.

=TimeStamp(Now()-ClaimDate,'hh:mm')

Can I use Age function in this secenerio?

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

You may use

Interval(Now()-ClaimDate,'hh:mm')

View solution in original post

7 Replies
nagaiank
Specialist III
Specialist III

You may use

Interval(Now()-ClaimDate,'hh:mm')

krishnacbe
Partner - Specialist III
Partner - Specialist III
Author

Hi

Thanks for your fast reply.

In either cases, my Dashboard is getting refreshed frequently. Dashboard contains more records.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi Kriamam,

I can't see any reason why you couldn't use Age() function to calculate age of the claim. Please follow this syntax

age(timestamp(Now()),date_of_birth (which in your case it will be CLAIM DATE)) meaning age(now(),claim_date)

Let me know if it works.

Regards,

Gab

krishnacbe
Partner - Specialist III
Partner - Specialist III
Author

Hi gabsus

If I use age(timestamp(Now()),claimdate), I am getting data in list box as -1 and 0.  My requirement is to display the age in days/Hours/Minutes.

Thanks in advance.

cesaraccardi
Specialist
Specialist

Hi,

You cannot use the Age function since it will return only integer values for years. If you just use Now() - claimdate the result will be the difference in days. For hour and minutes you can use krishnamoorthy suggestion.

Regards,

Cesar

swuehl
MVP
MVP

You can use a format code that includes the days, check out the format codes section in the HELP:

=Interval(Now()-ClaimDate,'dd hh:mm')

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

In that case what I will do is to use IF(age(now(),claim_date <0, age(now(),-claim_date,age(now(),claim_date)) this should give you right integer format.

Let me know if this is helpful or not

Regards,

Gab