Qlik Community

Ask a Question

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 
Search instead for 
Did you mean: 
bradleyfairclot
Creator
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.

Any help you can offer will be greatly appreciated.

1 Solution

Accepted Solutions
martynlloyd
Partner
Partner

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

View solution in original post

5 Replies
martynlloyd
Partner
Partner

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

simenkg
Partner
Partner

In your script define an Age field:

let vToday = Today();

load

$(vToday)-StartDate as Age


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

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

I do not know the name of your fields or your tables, so you have to adapt this to your application

Hope this helps
Regards
SKG

MK_QSL
MVP
MVP

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

martynlloyd
Partner
Partner

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

View solution in original post

Not applicable

Hi Bradley .

is what you need?

Regards!

DD