It depends on the ordering of the files within the folder and filelist() isn't an own Qlik function else just called a Windows function. AFAIK there is nothing what could be directly influenced on this feature unless you change the filenames manually or with an extra logic.
I'm not absolutely sure what your requirements are but I assume you could prevent this behaviour quite easily - by moving the statement: let vMaxDate = vDate; out of the loop below the next file statement. You may need some extra logic here to prevent that vMaxDate could be overwritten with a date in the past or is completely erased if no loop iteration is executed or any other unexpected stuff happens - maybe just: let vMaxDate = rangemax(vMaxDate, vDate);
- Marcus