Step1: Read Excel as Datatable (DT)
Step2: Use Invoke Code activity
DT.AsEnumerable().ToList().ForEach(Sub(row)
If dt.AsEnumerable().Where(Function(x) x(“SO”).ToString.Equals(row(“SO”).ToString)).CopyToDataTable.Rows.Count>1 Then
row(“Complete Remark”)=“X2”
Else
row(“Complete Remark”)=“X1”
End If
End Sub)
After you got all data that you need apply this sequence below:
1.Filter Data Table: Filter dataTable by [Complete Ship] = X and output to filteredDataTable.
2.For Each Row: Loop through filteredDataTable and for each row:
• Filter Data Table (inside the loop): Filter filteredDataTable where [SO] = row(SO).ToString and store in soDataTable.
• If Condition: soDataTable.Rows.Count = 1
• Then: Assign X1 to row(Complete Remark)
• Else: Assign “X2” to row(“Complete Remark”)
Write Range: Write the modified filteredDataTable back to Excel.