Hi Everyone,
I hope everyone is well.
I am looking for ways to deal with my problem. I have an excel file containing duplicate data. I want to retain only the row from column C,D,E,F whichever column have with value “Yes”
For example pleas see screenshot below:
So for this example I want to remove the row 6 and retain only the row 2 including the entries without the duplicates
Is that possible using uipath?
I attached the file for your reference.
example.xlsx (8.6 KB)
Below would be my trial to solve this issue:
- Use read range to capture the excel data into a datatable first
- I assume that you use both col A and col B to identify duplicate rows. So I will first add a new column to combine col A & B (i.e. combine them into A1, B2, C3, etc.). I will also add 1 more column as unique identifier (e.g. 1, 2, 3, 4, etc.)
- Use for each row loop to loop through datatable. For each row, copy the datatable into a new temporary datatable (e.g. tempDT), and then filter the tempDT with the combined column. If the tempDT has more than 1 rows, then loop through tempDT as well to find out which row doesn’t have a column with value of “Yes”. Mark the unique identifier down into a list for delete
- Delete the respective datarows marked in the list mentioned in 3 (If you delete the row directly in 3, it should encounter error)
I think this may not be the most efficient solution, but it should be able to get the job done.
@thewmak,
You can use Filter Datatable activity for this,
Filter Rows below shot,

Take only 3 columns as below,

That would filter all rows shown in Alvin’s example. I think he only want to filter out row 6 and keep row 2 to 5.
You’re correct about that @thewmak