I have a scenario like below and need help,
I need to get the range of Plant codes as a datatable based on the Company Code. The company code is my input. How can I get the plant codes as a datatable for the Company Code? For example: If the company code is 4000, The Plant code I need to get should be 4551-4556 as a datatable.
Thanks in Advance
@esakki1612 build one datatable-
In for each row in datatable
If currentrow(“company code”)=“4000”
Then add that datarow to datatable.
Outside for each remove datacolumn of company code from datatable
Hi @esakki1612 ,
Could you give this workflow a try and let us know if it works out for you?
//To find row which contains code
dt.AsEnumerable().ToList().FindIndex(Function (x) x("Company Codes").toString.Equals("5000"))
//Collects rows until next code
TakeWhile(Function(tk,i) i=0 OrElse IsNothing(tk(1)) OrElse String.IsNullOrEmpty(tk(1).ToString.Trim)).
FetchRowsBasedonCode.xaml (8.3 KB)
Book5.xlsx (8.8 KB)
Thanks alot Ashwin. It Worked
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.