I have an Excel file that contains 2 columns, A and B. I need to check if I have duplicates in column A and in such a case I need to remove the particular row whose column B contains a certain value.
For instance, in the next table I need to remove the duplicated row in column A that has ‘Bye’ value in Column B:
Column A | Column B
1234 | Hello
32 | Hello
12 | Hello
1234 | Bye
The table will be:
Column A | Column B
1234 | Hello
32 | Hello
12 | Hello
If the values of column B were the same, then any of the rows would be removed.
I think I have to be more specific with one point. I dont only need to get the ‘Hello’ values of column B.
If we have the following table:
Column A | Column B
1234 | Hello 32 | Bye
12 | Hello
1234 | Bye
The table will be:
Column A | Column B
1234 | Hello
32 | Bye
12 | Hello
I mean I only have to remove:
entire duplicated rows
if column A of a certain row has the same value than column A of another row, i have to check if any of them has the value ‘Bye’ in column B and remove this row. If both rows have the same value of column B then I have to remove one of them (no matter which one)…
Please, could you inform me if i explained myself properly?
@username_uipath
just enrich your sample data with more data and all cases.
duplicated rows
if column A of a certain row has the same value than column A of another row, i have to check if any of them has the value ‘Bye’ in column B and remove this row. If both rows have the same value of column B then I have to remove one of them (no matter which one)…
Thank you. I think this solution does not work for one of the requests.
if column A of a certain row has the same value than column A of another row, i have to check if any of them has the value ‘Bye’ in column B and remove this row. If both rows have the same value of column B then I have to remove one of them (no matter which one)…
I tried to not combine multiple Datatables and insterad work in 1 Datatable (might not be the most elegant solution).
What it does:
It checks for the first occurence in ColumnB for “Bye” and removes every row that has “Bye” in it afterwards.
…
Edit: Just saw you also have to filter Dupicates from Column A.
You can duplicate the posted workflow and write everything from Column B to Column A and your searchterm like “Bye” needs to be replaces with “1234” like in your example.
Just make sure to put an Assign [indexRow = 0] in between,
…
Cases:
1234: group with a Bye to remove
32: duplicates in group, get only 1 time 32
12: single member in group
58: duplicates with only Bye, 1 member to keep
57: single member in group, keep it also as it has value Bye