4

Does anyone know how to visualize in QGIS, in a group of points with an associated date, the point corresponding to the last date?

For example, a vector layer with 4 points:

id Name Date
1 Joana 2021-04-03
2 Rita 2020-12-05
3 Nuno 2021-01-12
4 Mary 2020-10-09

I just want to view the most recent date point, i.e. point 1.

0
6

If you have a field called Date which is a Date type, then you can use a "Categorized" style with this expression:

to_datetime("Date") = maximum("Date")

this will be 1 for features at the maximum date value and zero otherwise. Hit "Classify" and disable display of the zero category. Style the one category however:

enter image description here

Note how maximum("Date") is a "DateTime" type so you have to convert your "Date" to a "DateTime" type or the comparison doesn't work because your date is a "Date" type. Or at least the data I made up was, I used the "Date" type in the attribute field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.