Hi,
I am not getting the desire result which fetching the distinct value from the data table based on one column below is the example.
I want to get distinct data based on name col.
I have tried below
Dttest.defaultview.Totable(true,"id’,“name”,“course”)
Please help me in this
ppr
(Peter Preuss)
May 17, 2022, 12:09pm
2
Assign Activity
LHS: dtCleansed | DataType: DataTable
RHS:
(From d in YourDataTableVar.AsEnumerable
Group d by k=d("Name").toString.Trim into grp=Group
Select r=grp.First()).CopyToDataTable
1 Like
Sam_Abraham
(Sam Thomas Abraham)
May 17, 2022, 12:11pm
3
Hi @Harbansh_Singh ,
It seems you are using id and course also
Have you tried Dttest.defaultview.Totable(true,“name”)
1 Like
Hi @Sam_Abraham with the given solution it will return only name column not I’d and Course
@ppr how can we group by 2 column
Need to write seperate group by clause for that column? It i want to include Course Column also in group by
ppr
(Peter Preuss)
May 17, 2022, 1:16pm
7
(From d in YourDataTableVar.AsEnumerable
Group d by k1=d("Name").toString.Trim, k2=d("Course").toString.Trim into grp=Group
Select r=grp.First()).CopyToDataTable
For more info on LINQ also have a look here:
[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum
2 Likes
Thanks you @ppr for the linq link
system
(system)
Closed
May 20, 2022, 2:52pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.