DataTable - Process particular member from a group

As shown in image an employee ID should be processed only when latest code of Employee ID is 111; when any latest code of an employee ID is followed by 111. Assume code column is arranged in descending order.

Output result should be as shown

Hi @MEHER_BJ !
Sorry but I did not understand your business rule.
Would you mind explaining in another way ?

@MEHER_BJ
A very quick implementation we can do with group by and LINQ

(From t In dtData.AsEnumerable.Select(Function (x,i) Tuple.Create(i,x))
Group t By k= t.Item2(0).toString.Trim Into grp=Group
Let go = grp.OrderBy(Function (o) o.Item1).toList
Let chkIDX = If(go.Count = 1,0, go.Count - 2)
Where go(chkIDX).Item2(1).toString.Equals("111")
Select row = go.First().Item2).toList

Variables:
grafik

Flow:
grafik

input:
grafik

Log:
grafik

Also have a look here:

find starter help here:
MeherBJ.xaml (9.3 KB)