I have a layer in QGIS that has four date fields - date1, date2, date3, date4. Using pyqgis I wish to find the latest date (ignoring null values) for every record from these four columns and copy that value into a field called MaxDate.
If the four date fields are null, then MaxDate is set at the value of last_date
It feels like there should be an easy solution, but I have yet to crack it!
The fields are all 'QDate' format (yyyy-MM-dd)