Find max date


How can we find the max between dates?
I’m trying to find the newly created date between the dates below.



In a mapper snap you can use this expression to return the date that is earlier(or equal) if your dates are strings, otherwise if the values are already Dates, you can remove the calls to Date.parse():

Date.parse($date1) > Date.parse($date2) ? $date2 : $date1

@cjhoward18 Thanks, for your quick response. But those two dates will be in the same column. How can I find the recently created date from the same column?

Check out the Aggregate snap:

I used the snap configured like this screenshot below with a series of documents from a json generator that have a field called date1. Applying the Max function allowed me to find the Max date:

** correction I misread the post, you would want to use the MAX function not MIN.

1 Like