Hello Community, i want help

I want a help to group based on invoice number.
And write groups sortedly.Kindly help me to get a answer

Hi @Ferdi7110

can you elaborate your query please.

Regards

Hi @Ferdi7110 ,

If your data in excel

Use linq query to get unique values

and then pass the unique values in filter datatable
as filer value

And use sort datatable on the outcome of your sort datatable .

Hope it helps ???

My test input looks like this

Invoice no Job Desc. Name of the Customer Rate
A1 Engineer John Doe 100
B1 Engineer Akila 200
A1 Mentor Toni 300
D2 Developer Bing 555
1 Like

Depending on your test input

dt.AsEnumerable().GroupBy(Function(row) row.Field(Of String)("Invoice no")).OrderBy(Function(Group) Group.Key).SelectMany(Function(Group) Group.CopyToDataTable().AsEnumerable()).CopyToDataTable()

Hope it helps you!

Hi @Ferdi7110

Please use the below linq quer:

dt1.AsEnumerable() _
                   .OrderBy(Function(row) row.Field(Of String)("Invoice No")) _
                   .CopyToDataTable()

Please refer the below workflow


Input:
image

Output:
image

Regards

Thank you all for helping me

1 Like

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