How to group rows with similar data in a table

Hi, I have a table called TABLE1 with below columns,
COLUMN1 COLUMN2
aaa 111
bbb 555
aaa 222
bbb 777
ccc 888
aaa 999

I want to group them based on COLUMN1, like:
aaa 111
aaa 222
aaa 999
bbb 555
bbb 777
ccc 888

Is there a way to do it?

HI @manojj.yadav

Check out this expression

DtRead.AsEnumerable().OrderBy(Function (row) row("Column1").ToString).Select(Function (row) row).ToArray.CopyToDatatable()

Check out this Video link

Regards
Gokul

Sure, will checkout and see.

HI @manojj.yadav

Check out the XAML file

SortDt.xaml (7.9 KB)

image

Output snap

image

Regards
Gokul

Currently the output looks like only sorted. So Goku shared some approaches with you.

  • LINQ
  • Sort DataTable Activity

When it is about forming groups we can do with a group by

1 Like

Hi @manojj.yadav

Check out this thread for group by expression

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