How about this script, This script works file for me
Main:
Load * From Table;
INNER JOIN (Main) LOAD max(DateFile) as DateFile RESIDENT Main;
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful