@atomic
your implementation has a look that it targets a different requirement. It will help if you provide a complete described output sample on the given input sample data from above. Based on this we can better check the solution options. Thanks
@ppr The output I show in the post at the top is what I need to be able to process column B and E easier. The input are datatables that look like something like this:
I need it filtered on column A,C and D like the output shows:
That’s why I am doing it like in my flow above. I just wonder if I can do it with less code.
You provided a linq statement. But I think that I need to loop through the original datable so I can process column B and E easier. I need to compare column B and E with eachother but only when the values at column A, C and D are of the same value/type.
Right now I sorting it in two steps, first at Remittent and then at Payment Unit.
Note that the excel example is just and example with fabricated column names.
I will try to explain again, the Input Datatable has different values each days. The datatable needs to be sorted at column A,C and D(these column rows must have the same values).
This is why the output will vary from day to day. But to make it easier to understand.
Lets say that I have this Input:
I want to use this within a for each activity to get this:
Then this:
and lastly this:
In the for each activity I want to do some calculations based on these filtered datatables.
assign activity:
left side: TableList - Datatype: List(Of DataTable)
right side:
(From d in dtData.AsEnumerable
group d by k1=d(0).toString, k2=d(2).toString, k3=d(3).toString into grp=Group
Select g=grp.CopyToDatatable).toList
For each activity: table - in TableList #TypeArgument: Datatable
now you can process the groups e.g. with a for each row activity
in case of the order of the groups is required we can modify the LINQ by applying some orderings
Create two LINQs:
One for all the unique list of Company names - CompanyVariable = Dt_Table.AsEnumerable.Select(Function(x) x.item(“Name”).ToString).Distinct.ToList
And the other for the result you want -
For each row(DataType String) Dt_Loop = Dt_Table.AsEnumerable.Select(Function(x) x.item(“Name”).ToString.Trim = CompanyVariable))
Note: My UiPath isn’t working for some reason, so I wasnt able to test them out, try playing around with the keywords and see what works.