# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for
Did you mean:
Creator

## Need to calculate Age by First Date

I have a group that has two start dates, and I need to calculate the age of the group by subtracting the first start date from Today(). I have used firstsortedvalue some, but that is selecting an amount that goes along with the first date.

Example:

First Date: 1/1/2014

Second Start Date: 3/1/2014

Need a formula to calculate Today() - First Date(1/1/2014)= Answer.

1 Solution

Accepted Solutions
Partner

If dates are in same field use
Interval(Today() - Min(StartDate),'D')

5 Replies
Partner

Interval(Today() - First Date(1/1/2014),'D') will give you the age in days...

Partner

In your script define an Age field:

let vToday = Today();

\$(vToday)-StartDate as Age

Then you can have the max age of a group as:

sum(aggr(max(Age),Group))

Hope this helps
Regards
SKG

MVP

Age(Today(),FirstSortedValue(Date,Date))

Partner

If dates are in same field use
Interval(Today() - Min(StartDate),'D')

Not applicable