(From d In Dtinput.AsEnumerable
Group d By k=d(0).toString.Trim, k2=d(1).toString.trim,k3=d(2).toString.trim Into grp=Group
Let ra = New Object(){k,k2,k3}
Select dtGrouped.Rows.Add(ra)).CopyToDataTable
Hi @Meyammai
You can also try this:
convert your excel as Datatable using Read range activities,
Later you can use Remove Duplicates row activity and Sort Datatable Activity.
@Meyammai
your case is about grouping and custom sort
give a try on following:
create a dictionary string, int3 and store the Prio Values along with its sort rank
dictCustomOrder =
new dictionary(Of String, Int32) From {
{“High”, 1},
{“Medium”, 2},
{“Low”,3}
}
Use an assign activity
left side: dtResult | Datatype: DataTable
right side:
(From d In dtData.AsEnumerable
Group d By k1=d(“Node”).toString.Trim, k2=d(“Description”).toString.Trim Into grp=Group
Let go = grp.OrderBy(Function (x) dictCustomOrder(x(“Priority”).toString.Trim))
Select go.First()).CopyToDataTable