Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
carahyba
Partner - Contributor III
Partner - Contributor III

Why Max Date is never equal to Date?

Hi, there.

I'm trying something like described in this post: How exclude Rows from table? | Qlik Community. But, for some unknown reason (at last for me), the IF statement is never true. An example is attached, if someone can help, I appreciate.

Thanks.

C.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

=Aggr(If(Max(TOTAL <Doc>[Date]) = Date,'Yes','No'), Doc, Code, Date)


Capture.PNG

View solution in original post

5 Replies
sunny_talwar

Try this:

=Aggr(If(Max(TOTAL <Doc>[Date]) = Date,'Yes','No'), Doc, Code, Date)


Capture.PNG

oknotsen
Master III
Master III

No clue why your If statement does not work (except that apparently it is wrong), but here is an alternative solution:

Assuming the table you load first is called "Source", add this to your script:


DateTmp:

Left Join(Source)

Load

  Doc,

  date(max(Date)) as MaxDate

Resident Source

group by Doc

;

After that, you can add this expression to your chart:

If(Date = MaxDate, 'Yes', 'No')

May you live in interesting times!
carahyba
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much!

carahyba
Partner - Contributor III
Partner - Contributor III
Author

Thank you so much!

carahyba
Partner - Contributor III
Partner - Contributor III
Author

Both are correct answer! Unfortunately I can choose only one, so I checked the first one. But in the attach I implemented both.

Thanks again, @Sunny and @Onno.

Best regards!