Sort a datatable by count of duplicate

Hi everyone. I’m not that familiar with complex LINQ. How can I sort a datatable by count of duplicate? Please see image below. Thank you!


Hi @mnlatam

You can try sort datatable activity for this


Nived N

Happy Automation

1 Like

have a look here:

find starter help here:
Sort_ByGroupCount_1Col.xaml (6.8 KB)

Just adopt the Column Index by the Idex Or ColumnName from your scenario


This works for me, thanks as always @ppr :smile:

PS: I’ve been seeing SelectMany method in some solutions, what does this method basically do?

with selectmany we flattens the grp.toList (A list of datatrows) into one sequence.

Happy to hear about that it is working. May we ask you on flagging the solving post as solution after you have done with the final testings. Thanks

1 Like

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