Hello please help me in this scenario
Input file is given
InputData.xlsx (11.9 KB)
The process should get looped
After fetching it should store in array values. ID101 = Array{Child values)
Thankyou
soundarya
Hello please help me in this scenario
Input file is given
InputData.xlsx (11.9 KB)
The process should get looped
After fetching it should store in array values. ID101 = Array{Child values)
Thankyou
soundarya
Please try this
Syntax
Array of string = DT1.AsEnumerable.SkipWhile(Function(x) x(“Parent”).ToString<>“ID115”).TakeWhile(Function(x) x(“Child”).ToString<>“ID101”).Where(Function(x) not String.IsNullOrEmpty(x(“Parent”).ToString) or String.IsNullOrEmpty(x(“Parent”).ToString)).Select(Function(x) x(“Child”).ToString).toarray
it helps!
Hi
Just now checked but not optimistic so
Can you give LINQ syntax for only ID101
Check This is one for ID101
Syntax : DT1.AsEnumerable.SkipWhile(Function(x) x(“Parent”).ToString<>“ID101”).TakeWhile(Function(x) x(“Parent”).ToString<>“ID115”).Where(Function(x) not String.IsNullOrEmpty(x(“Parent”).ToString) or String.IsNullOrEmpty(x(“Parent”).ToString)).Select(Function(x) x(“Child”).ToString).toarray
It Helps!
Hi,
Can you try the following sample?
dict = dt.AsEnumerable.Select(Function(r,i) Tuple.Create(dt.AsEnumerable.Where(Function(r2,j) j<=i AndAlso r2(0).ToString<>"").Last() ,r(1).ToString)).GroupBy(Function(t) t.Item1.Item(0).ToString).ToDictionary(Function(g) g.Key,Function(g) g.Select(Function(t) t.Item2).ToArray)
Sample20230922-4L.zip (10.6 KB)
Regards,
can you develop for this input
suppose i need only id-124 child items
DT1.AsEnumerable.SkipWhile(Function(x) x(“Parent”).ToString<>“doc id-124”).TakeWhile(Function(x) x(“Child”).ToString<>“doc id-132”).Where(Function(x) not String.IsNullOrEmpty(x(“Parent”).ToString) or String.IsNullOrEmpty(x(“Parent”).ToString)).Select(Function(x) x(“Child”).ToString).toarray
If i executed this query i am getting child items from Department_29 to dummy2(1).ppt
Thankyou
Use This
DT1.AsEnumerable.SkipWhile(Function(x) x(“Parent”).ToString<>“doc-id-124”).TakeWhile(Function(x) x(“Parent”).ToString<>“doc-id-132”).Where(Function(x) not String.IsNullOrEmpty(x(“Parent”).ToString) or String.IsNullOrEmpty(x(“Parent”).ToString)).Select(Function(x) x(“Child”).ToString).toarray
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.