Hi UiPath,
On my situation I needed to split a dynamic Data Table based on the distinct values of a column.
Example:
| Billing Document |
Serial Number |
| ABC1234 |
SH00123151 |
| ABC1234 |
SH131A8911 |
| ABC5678 |
SH131A8911 |
| ABC5678 |
SH1231AAAA |
As you can see in the column “Billing Document” there are 2 distinct values. These are ABC1234 and ABC5678.
My question is how can I create dynamic data table for each distinct value? These Distinct values might change
Hope my question make sense.
Advance Thanks!
ppr
(Peter Preuss)
2
Assign Activity
TableList | DataType: List(Of DataTable) =
(From d in yourDataTablevar.AsEnumerable
Group d by k=d("Billing Document").toString.Trim into grp=Group
Select t = grp.CopyToDataTable).ToList
then loop over TableList and process the split DataTables as needed
lrtetala
(Lakshman Reddy)
3
Hi @alvin.c.apostol26
Try this
dt.AsEnumerable.GroupBy(Function (x) x("Billing Document").ToString.Trim).Select(Function (x) x.CopyToDataTable).ToList
Regards,
ppr
(Peter Preuss)
4
@alvin.c.apostol26
Also have a look here:
first part describes a Non-Linq approach
1 Like
system
(system)
Closed
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.