Excel, Datatable, Integer, String

Hi Team,

I merged 2 data tables into a single data table.

I used the following to get the specific column and also remove duplicates.

FilterDT.DefaultView.ToTable(True, “Date”,“RowNumber”)

The duplicates are not removed as the final data table is a combination of string value and integer values. If I change the entire column values as integer means I can easily remove the duplicates.

image

Kindly help me out to get the solution.

Thanks in Advance

Hi @manikandan.murugan

Try this way:
=> Use For Each row in DataTable to iterate through the merged datatable variable FilterDT.
=> Inside the loop use Assign activity and give below syntax:
CurrentRow("RowNumber") = Decimal.Parse(CurrentRow.Item("RowNumber").ToString)
=> Outside the loop use the below condition in Assign activity:
FilterDT = FilterDT.DefaultView.ToTable(True, "Date","RowNumber")
=> Write Range Workbook FilterDT back to excel.

Regards

1 Like

Hi @vrdabberu

Thank you so much its working.

Happy Automation…!

1 Like

You’re welcome @manikandan.murugan

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.