Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
yura_ratu
Partner - Creator II
Partner - Creator II

Get value of the field by max value of another

Hi all,

How can I found value of one field, corresponded to max value of another field. In a chart

Example attached. Thank you

1 Solution

Accepted Solutions
rubenmarin

Hi Yuriy, set analysis won't work if you want to calculate it row by row, you can use an expression like:

Aggr(If(Date=Max(TOTAL <ID> Date), Sum(Value)), ID, Date)

View solution in original post

4 Replies
robert_mika
Master III
Master III

Try:

sum({$<Date={$(= max (ID))}>}Value)

rubenmarin

Hi Yuriy, set analysis won't work if you want to calculate it row by row, you can use an expression like:

Aggr(If(Date=Max(TOTAL <ID> Date), Sum(Value)), ID, Date)

yura_ratu
Partner - Creator II
Partner - Creator II
Author

I guess you meant

sum({$<Date={$(= max (Date))}>}Value)

Doesn't work. It tries to find max date from all model in every ID. But I need to calculate max date for every specific ID

yura_ratu
Partner - Creator II
Partner - Creator II
Author

Hi Ruben. It works! Thanks a lot