Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
PP_12
Contributor III
Contributor III

Aggr(Max(date) within If statement brings the wrong result

Hi, 

I would like to know if it is possible to highlight the max dates of an each ID and still have the rest of the dates remain in the table. I would my results to be like table 1 below. I have created a measure column with aggr(max(date1),ID) and it brings correct results with nulls but would like to avoid creating this coloumn as I need all dates. I put this inside an IF statement then I get the wrong results (table 2).

Table 1 - Desired Result

ID Date1
124 30/12/1996
124 24/01/2021
125 06/10/2012
125 15/05/2022
127 09/08/1990
127 29/03/2013

 

Using  If(Aggr(Max(Date1),ID),yellow())   within the column background color expression -I keep getting the wrong result. I get the result below. Could I please get help with this?

Table 2 - Incorrect Result

ID Date1
124 30/12/1996
124 24/01/2021
125 06/10/2012
125 15/05/2022
127 09/08/1990
127 29/03/2013

 

Kind regards, 

Penny

 

 

Labels (1)
2 Replies
justISO
Specialist
Specialist

Hi, try this:

If(Date1 = Aggr(nodistinct Max(Date1),ID),yellow())

PP_12
Contributor III
Contributor III
Author

Great, thank you. It looks like it works will need to try in my main application