Hi
I’m a beginner in UiPath and i’m trying to solve this task
I’m trying to remove duplicate rows from an excel sheet based on particular column,
if two rows is duplicated then i have to keep the newest row based on “Transaction time” column,
" * Remove duplicate based on the “Main Transaction” column, the priority is based on the “Start Transaction Time” column. keep the newer transactions."
Company_1.xlsx (31.4 KB)
in this excel sheet i need to remove duplicate rows
we can recognize the duplicates by “Main Transaction” column,
the priority is based on the “Start Transaction Time” column we need to keep the newer transactions.
Assign Activity
Leftside: dtResult | DataType: DataTable
Right side:
(From d in YourDataTableVar.AsEnumerable
Group d by k=d("Main Transaction").ToString.Trim into grp=Group
Let go = grp.OrderBy(Function (x) CDate(x("Start Transaction Time").toString.Trim))
Select r=go.Last()).CopyToDataTable
Here we prefer allways details. What was done? What is not working. Maybe you can share some screenshots from the omplementation details or your XAML with us
@Karam_Abulawii
We would suggest to do the line breaks of the statement as done in example from above
Give another more clear name to variable instead of BuildDataTable
Please show us the variable panel and settings of the origin datatable
Also ensure following:
Group d by k=d(“Main Transaction”).ToString.Trim into grp=Group