How to generate datatables equal invoice codes?

Good afternoon friends;

One query please, I need read an excel file and generate datatables with equal invoice codes (column A)

The expected result would be a data with the following rows:

expected result:

dt1:
factura item
1 1
1 2
1 3

dt2
factura item
2 1

dt3
factura item
3 1

dt4
factura item
4 1
4 2
4 3

dt5
factura item
5 1

We assume the excel is read in within a data table - dtData
Assign Activity:
dtUnique =

(From d in dtData.AsEnumerable
Group d by k=d("factura").toString.Trim into grp=Group
Where grp.Count = 1
Select grp.First()).CopyToDataTable

just correct the wrong configured datatype from:


to
grafik

in such cases we would recommend to read carefully the validation messages as it gives us often the clear hint on what is to fix

1 Like

Thanks you very much @ppr

@ppr
I was wrong, what I required was the following;

I know that excel in the attachment, it is required to generate a data table for each different group, some datatables like this:

expected result:

dt1:
factura item
1 1
1 2
1 3

dt2
factura item
2 1

dt3
factura item
3 1

dt4
factura item
4 1
4 2
4 3

dt5
factura item
5 1

Assign Activity
LHS:TableList | DataType: List(Of DataTable)
RHS:
dtUnique =

(From d in dtData.AsEnumerable
Group d by k=d("factura").toString.Trim into grp=Group
Select grp.CopyToDataTable).toList
2 Likes

I don´t underand these, could you explain me please

LHS:TableList | DataType: List(Of DataTable)
RHS:

You will see more often here in the forum:
grafik
LHS: Left hand side

just put on LHS a variable with name TableList of DataType: List(Of DataTable)
grafik

1 Like

Thanks a lot friend,

I’m going to try it, although I don’t understand that thing about lists, will it help me to be able to work with each datatable independently?

find starter help here:
GroupBy_1Col_Split_toTableList.xaml (11.8 KB)

1 Like
1 Like

Thanks @ppr

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