Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
I have some fields like Branch, Case,Down_since and Up_Since, now my issue is multiple tickets have same Up_since in a branch. I need to captured same Up_since tickets as flag 1 and minimum down_since for that tickets should be flag as 0, I'm attaching one excel file in that one Output column is there i'm expecting that...Please help me friends.
When you load the data in the script, order by Up_Since and Down_Since DESC and use peek() to see if the previous row have the same Up_Since, like:
TABLE2:
LOAD *, if(Branch = peek('Branch') and Up_Since = peek('Up_Since'), 1, 0) as Flag
RESIDENT TABLE1
ORDER BY Up_Since, Down_Since DESC, Branch
DROP TABLE1;
I am not sure how you are getting the output. Can you explain the logic
I was going to ask the same thing. I am confused
Why are there two 0's in the screenshot
When you load the data in the script, order by Up_Since and Down_Since DESC and use peek() to see if the previous row have the same Up_Since, like:
TABLE2:
LOAD *, if(Branch = peek('Branch') and Up_Since = peek('Up_Since'), 1, 0) as Flag
RESIDENT TABLE1
ORDER BY Up_Since, Down_Since DESC, Branch
DROP TABLE1;
Sorry Sunny,
In excel that output column we manually created.Inside Blue colour tickets are duplicate tickets in that red colour ticket is original ticket based that is minimum down_since when compare to all duplicate tickets.