Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
nicolai_moller
Contributor
Contributor

oldest date and aggr() in expression

Hi

I'm trying to to write an expression (in a pivottable) that finds the oldest date in each case and displays the number of days between that date and today, for each case.

So far, all I have is this:

avg(aggr(avg(Today()-Date),Cases))

But it returns the average of all dates in each case and displays the number of days between the average and today.

How do I calculate the duration between today and the oldest date?

Thanks.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

Check if fit your needs

View solution in original post

3 Replies
Clever_Anjos
Employee
Employee

Did you try

Today() - Min(Date)

?

nicolai_moller
Contributor
Contributor
Author

Forgot to mention that I want the average displayed as a total.

If i type today()-min(Date) the average in the subtotal will display the number of days between the oldest date across all cases and today. And not the average of the duration of all cases.

Clever_Anjos
Employee
Employee

Check if fit your needs