So, if I am thinking this correctly, I think the only places that would be left would be the places where you have 1st duplicates cause everything else will either have Dup or NoDup. Can you do something like this:
LOAD If(Len(Trim(DupRec)) = 0, 'Dup', DupRec) as DupRec;
LOAD if (peek('Line_ID',-1) = Line_ID ,'Dup','NoDup') asDupRec
I think, since QlikView loads the table one record at a time, from the top down, there's no way to do this in one go - you'll have to do one RESIDENT LOAD in reverse sorting order and do the same as the first time round.