In the attached Screenshot above table is the Input Table I need a LinQ for the below output table.
Thank you
In the attached Screenshot above table is the Input Table I need a LinQ for the below output table.
Thank you
Hi,
Can you try the following sample?
dt.AsEnumerable.GroupBy(Function(r) r("LOS_No").ToString).Select(Function(g) dt.Clone.LoadDataRow({g.Key}.Concat(g.Select(Function(r) r("Loan_No_L").ToString).Distinct()).ToArray,False)).CopyToDataTable()
Sample
Sample20240319-5.zip (8.8 KB)
Regards,
Iām getting the correct output but I missed one column(Without āLā) for both First Loan No & Double Loan No, can you please update your LinQ a bit?
@Yoichi Are you solving it?
How about the following?
dt.AsEnumerable.GroupBy(Function(r) r("LOS_No").ToString).Select(Function(g) dt.Clone.LoadDataRow({g.Key}.Concat(g.Select(Function(r) Tuple.Create(r("Loan_No_L").ToString,r("Loan_No_L_Without_L").ToString)).Distinct().SelectMany(Function(t) {t.Item1,t.item2})).ToArray,False)).CopyToDataTable()
Sample20240319-5 (2).zip (9.7 KB)
Thank you so much for the quick solution!!!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.