I can't find a way to do what I want.
I got a certain number of features. I want to find the max(date) on attribute date for those features, but I want the max(date) to be in relation to a condition on a value from an another attribute status.
So I want the max(date) to be calculated and returned
first from feature where status = completed
if no features have a status=completed then returned max(date) from the other features
1 20230330 completed
2 20230329 completed
3 20230331 running
4 20230329 waiting
would returned max(date) from feature 1 : 20230330
1 20230330 waiting
2 20230329 running
3 20230331 running
4 20230331 waiting
would returned max(date) from feature 3 or 4 since no value set to completed :
20230331