Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jose_vargas
Creator
Creator

AVG value from Max date

Hello community.

I have the next information in QVD

NumProc     |     Date          |     TimeResp     |      User

-----------------------------------------------------------

1111               15/12/2016          15.00               JVARGAS

1111               17/12/2016          12.25               JVARGAS

1111               13/12/2016          11.50               JRIOS

2222               01/01/2016          10.20               JRIOS

2222               30/12/2016          14.52               JVARGAS

2222               31/12/2016          17.54               JVARGAS

I need the average of "TimeResp" but i just need take the max date for each "NumProc", and this AVG is for User.

So, my result have to be like this:

User          |     AVG(TimeResp)

----------------------------------------------

JVARGAS     14.90

I have 2 NumProces (1111 and 2222), for 1111 the max date is "17/12/2016" and for 2222 the max date is "31/12/2016", so i use the TimeResp  12.25 and 17.54 for average.

I try whit set analysi but its not work:

AVG({$Date={"$(=max(Date))"}>}TimeResp)

Pelase help what should i use.

1 Solution

Accepted Solutions
sunny_talwar

Here is a sample attached

Capture.PNG

View solution in original post

3 Replies
sunny_talwar

May be this:

Avg(Aggr(FirstSortedValue(TimeResp, -Date), User, NumProc))

sunny_talwar

Here is a sample attached

Capture.PNG

jose_vargas
Creator
Creator
Author

Thanks a lot.. Its Works (Y)