How to list only latest tasks based on date in file name

What I’m trying to do

I am listing all the uncompleted tasks in my vault, sorted by folder and by filename, by using the Tasks plugin.
The actual code I am using is like this:

not done
group by folder
path includes LogNote
sort by filename reverse

The tasks in my vault are contained in log notes which I write every day in which all the tasks are repeated, being complete or not, because every new log note is a copy of the previous one, which then I update.
All this log notes have the creation date in the filename.
The problem is that the list I get contains multiple repeated tasks from all the files.

I would like to filter the list I am getting by showing the tasks from the notes with the latest date in the filename.
How can I show only the uncompleted tasks from the latest files from each folder of my vault?

Not a user of the tasks plugin, but could it be that the group by folder interferes with your sort by filename? I’d try the query without that group by statement.

Secondly, what kind of filenames are you using? What is the dateformat used?