Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III

Show maximum number of average days between two date columns in a textbox

I have ID, Start Date, End Date.

I need to show the maximum average number of days between start date and end date in a  text box.

I already know how to calculate individual average # of days between Start and End dates using

aggr(avg((date( [Start Date]- [End Date]))),ID)

I need to show the highest value of this expression (Highest avg days) in a textbox

Labels (4)
1 Reply
cristianj23a
Partner - Creator III

Hello, I created some test data with the solution, confirm if it is what you need:

Data:
LOAD * INLINE [
ID, StartDate, EndDate
1, 2023-01-01, 2023-01-05
2, 2023-02-01, 2023-02-10
3, 2023-03-01, 2023-03-05
4, 2023-04-01, 2023-04-20
5, 2023-05-01, 2023-05-15
];

 

Measure:

max(aggr(avg(Date([EndDate]) - Date([StartDate])), ID))

 

Image:

cristianj23a_0-1691526778323.png

 

Regarts.

 

 

 

 
https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.