Hi,
I need to add items into queue based on ascending order
Ex
ID
101
101
101
102
102
103
have to add items into queue in below order
103
102
102
101
101
101
Hi,
I need to add items into queue based on ascending order
Ex
ID
101
101
101
102
102
103
have to add items into queue in below order
103
102
102
101
101
101
Try to do a sort before adding
If it is datatable use dt = dt.AsEnumerable.OrderByDescending(function(c) Cint(x("ID").ToString))
Or use sort datatable activity if that works
Cheers
I need to add items based on count of I’ds in ascending order
Ex
ID NO
1A101
1A101
1B102
1C103
1C103
1A101
–—–—----------------
1A101 - 3
1B102-1
1C103-2
Need to add items to queue in below order
1B102. .-1
1C103. -2
1A101 - 3
Hi @Kishore_Raj
Try this:
sortedOutput = YourDataTable.AsEnumerable() _
.GroupBy(Function(row) row("ID").ToString()) _
.Select(Function(group) YourDataTable.Clone.LoadDataRow({group.Key, group.Count()}, False)) _
.OrderBy(Function(row) CInt(row("Count"))) _
.CopyToDataTable()
sortedOutput is of DataType System.Data.DataTable
Hope it helps!!
Then try this
Dt = dt.AsEnumerable.GroupBy(function(x) x("ID").ToString).OrderByDescending(function(x) x.Count).SelectMany(function(x) x).CopyToDataTable
Cheers
Thanks for your reply, it is working in descending order.is it possible in ascending order also
If you find solution for the query please mark it as solution to close the loop.
Happy Automation
Regards
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.