Filter Datatable with LINQ/Lambda

Hello everyone!
I have this datatable and want to filter it by some condition to result this output:
I want on the first to retain the name of the ORD column and on the DRAWINGS column to put all values from the DRAW column where for each item these condition are true.

kord <> 100

widi = 1

wdno = some text, not empty

draw = some text, not empty

Thank you!

Hi,

Can you try the following sample?

dtResult = dt.AsEnumerable.Where(Function(r) Int32.Parse(r("kord").ToString)<>100 AndAlso Int32.Parse(r("widi").ToString)=1 AndAlso (not String.IsNullOrEmpty(r("wdno").ToString)) AndAlso (not String.IsNullOrEmpty(r("draw").ToString))).GroupBy(Function(r) r("ord").ToString).Select(Function(g) dtResult.LoadDataRow({g.Key,String.Join(";",g.Select(Function(r) r("draw").ToString))},False)).CopyToDataTable

Sample20220107-a1.zip (2.9 KB)

Regards,