Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I can easily enough find what records are duplicated :
if (peek('Line_ID',-1) = Line_ID ,'Dup','NoDup') as DupRec
But this will only mark the 2nd record, I need to mark the first one as well, ie mark them both as duplicate?
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:
YourTable:
LOAD If(Len(Trim(DupRec)) = 0, 'Dup', DupRec) as DupRec;
LOAD if (peek('Line_ID',-1) = Line_ID ,'Dup','NoDup') as DupRec
....
From/Resident xyz
Order by Line_ID;
Let me know if it doesn't work.
Best,
Sunny
Hi Dermot,
Try like this....
if(Peek('Line_ID')=Line_ID,0,1) as Flag
from resident table
order by Line_ID
Still gives the same result, only in reverse.
Hi Dermot,
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.
Best regards,
DataNibbler
Did you take a shot at what I suggested? Just curious
Try Like this....
Order by Line_ID DEC
Could you use Peek('Line-ID', RowNo()+1,'table') to check for the next to get a flag on the first one too.
OK Trying This :
If (Peek('Line_ID',-1) = Line_ID,'Dup', If(Peek('Line-ID', RowNo()+1,'Orders') = Line_ID,'Dup','NoDup')) as DupRec
Doesn't work either....
I guess for some reason you hate my suggestion. I was just trying to help.
I hope you get what you are looking for.
Best,
Sunny