Lynx
(Lnx)
1
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
ppr
(Peter Preuss)
2
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
ppr
(Peter Preuss)
4
just correct the wrong configured datatype from:
to
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
Lynx
(Lnx)
5
Thanks you very much @ppr
Lynx
(Lnx)
6
@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
ppr
(Peter Preuss)
7
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
Lynx
(Lnx)
8
I don´t underand these, could you explain me please
LHS:TableList | DataType: List(Of DataTable)
RHS:
ppr
(Peter Preuss)
9
You will see more often here in the forum:
LHS: Left hand side
just put on LHS a variable with name TableList of DataType: List(Of DataTable)
1 Like
Lynx
(Lnx)
10
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?
ppr
(Peter Preuss)
11
1 Like
system
(system)
Closed
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.