Hot to filter Duplicate record in excel based on Latest Date Hire.
if person number has a duplicated record, i need to filter the Latest Hire Date
Thank you in advance
- Vinent
Hot to filter Duplicate record in excel based on Latest Date Hire.
if person number has a duplicated record, i need to filter the Latest Hire Date
Thank you in advance
Hi,
Hope the following sample helps you.
dt = dt.AsEnumerable.GroupBy(Function(r) r("Person Number").ToString).Select(Function(g) g.OrderBy(Function(r) DateTime.Parse(r("Hire Date").ToString)).Last).CopyToDataTable
Main.xaml (10.3 KB)
Regards,
hi @Yoichi
Upon Reading the record,
The headers is unchecked.
Because it has a duplicate column in the record
so i must read it without header to get the 1st Column (Person Number)
But it thorws me error like this
in_dtRoaster.AsEnumerable.GroupBy(Function(r) r(“Column1”).ToString).Select(Function(g) g.OrderBy(Function(r) DateTime.Parse(r(“Column15”).ToString)).Last).CopyToDataTable
Please help
Thank you
Hi,
The above error means “Column15” has invalid DateTime string (or blank). Can you check this?
Regards,
Hi,
Is there “Hire Date” as data at Rows(0) in Column15? If so, it will cause error because it’s not valid datetime string.
Regards,
How do i solve this?
regards
Hi,
Quick solution is to remove row#0 using Remove DataRow activity.
Regards,
hi @Yoichi
Can you give me example?
I tried to look for the solution, but this is not exactly what I need.
Hi,
For now, can you try to put Remove DataRow activity just before the Assign activity as the following? Please set datatable variable and 0 at each property of the activity.
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.