rpa_22
(Rpa 22)
June 7, 2022, 9:15am
1
Hello everyone !
I am using:
NewDT = MainDT.DefaultView.ToTable(true,“Product”,“Customer”,“Account”,“Location”)
to get these values distinct datatable, but this function remove other columns.
Is there any other solution which keeps related other columns?
ppr
(Peter Preuss)
June 7, 2022, 9:20am
2
@rpa_22
Welcome to the forum
give a try at following:
Assign activity:
LHS: dtDistinct | datatype: DataTable
RHS:
(From d in YourDataTableVar.AsEnumerable
Let k=String.Join("_", {"Product","Customer","Account","Location"}.Select(Function (x) d(x).toString.Trim))
Group d by k1 = k into grp=Group
Select r = grp.First()).CopyToDataTable
rpa_22
(Rpa 22)
June 7, 2022, 9:46am
3
Thanks for quick reply & solution !
system
(system)
Closed
June 10, 2022, 9:47am
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.