Remove duplicate rows based on a value from a single data column

I want to remove duplicate rows from a datatable if a particular column1 value is duplicate in other rows.


when I try this it removes all the columns as well, but I need the rest of the columns.

1 Like

@banerjeerules check attached file i hope its useful (12.8 KB)


You can try filter data activity if feasible

1 Like

Thanks this works in getting the datatable sorted, but when I write the data table on the same excel sheet the remaining rows stays back… if I write on a different sheet it is fine. Can you tell me how can I write on the same sheet from where I am picking it up.

You need to first clear the Excel sheet. As read range will just overwrite the already present rows. Use hot keys to clear the excel sheet first then use a write range.

Below are the steps

Use Excel Application scope
Select Range ->Menstion the sheet name and Range->“A1”
use Send hot key → ctrl+A (Provide selector to the excel sheet)
use Send hot key → delete
use Send hot key → ctrl+s
Then use Write Range with your filtered DataTable.


@indra using your code I get the following error Assign : Unable to cast object of type ‘System.Double’ to type ‘System.String’. Can you help

@banerjeerules Do you change code in assign activity ?

1 Like

I changed the whole excel to text format now it works