I'm using QGIS 3.6

I have a point layer with the 84000 animal positions on a fence on varying dates.

I would like to obtain the nearest other animal to each animal point, on the condition the Date is the same. I have been able to add the nearest animal ID and its distance, but only by one date selection at a time.

Can I select all to do it at the same time, but on the condition the date matches?

I tried using a python code base on a different question but for QGIS 2.18 and I can't adapt it for more recent versions... maybe someone else can, link below for reference.

Finding closest segment to point which contains same attribute using NNJoin plugin of QGIS?

closed as off-topic by PolyGeo Apr 25 at 13:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.