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

get max date value

Hi Community,

I have to show max date value in straight table - for below selection i have to show max Extract date, that should be 30/07/2019 and respective value BCD -2000. 

I have tried with  : SUM({<ADV_ExtractDate={'$(=Max(ADV_ExtractDate))'}>}Amount), but it's not working .

can you please help..

 

Thanks in Advance!

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar

Can you try this

Sum(Aggr(If(ADV_ExtractDate = Max({<Service *= {"*"}>}Total <AdviserName, ContactID> ADV_ExtractDate), Sum(Amount)), AdviserName, Service, ADV_ExtractDate, %Key, ContactID))

View solution in original post

21 Replies
tresesco
MVP
MVP

Your field name in set analysis needs to be corrected, may be:

SUM({<ADV_ExtractDate={'$(=Max(ADV_ExtractDate))'}>}Amount)

paulwalker
Creator II
Creator II
Author

I'm sorry, have written incorrect.

Updated in main  post

tresesco
MVP
MVP

By correcting the field name, I could get the value. Could you explain a bit more about your expected output? 

paulwalker
Creator II
Creator II
Author

Thanks for looking it..

My output should be value should be in one level, if it is cover in ABC, should not be in another level.

Output attached in the Application.. (which i have highlight in red, should not be in)

AdviserNameServiceABCBCDDEFEFG
Andrew Savage -20002000-
Claire Keen 2000---
Ian Waddell (Onshore) 53002550--
Ken McCall 34003400--
Kevin  Taylor (Onshore) 4800---
Regina Tan -1300050005000
tresesco
MVP
MVP

This?

FirstSortedValue(DISTINCT Aggr(Sum(Amount),AdviserName, Service), -ADV_ExtractDate)



paulwalker
Creator II
Creator II
Author

Have tried this, for JULY and ContactID - value should  be only for BCD 

It should be Maximum of ADV_ExtractDate.

123.PNG

 

tresesco
MVP
MVP

Try without Service in aggr(), like:

FirstSortedValue(DISTINCT Aggr( Sum(Amount),AdviserName), -ADV_ExtractDate)

paulwalker
Creator II
Creator II
Author

No Luck!

Do you think any script issue ?

sunny_talwar

May be this

Sum(Aggr(
    If(ADV_ExtractDate = Max(Total <AdviserName> ADV_ExtractDate), Sum(Amount))
, AdviserName, Service, ADV_ExtractDate))