I need to get the data into a data table based on the ticket number.

For example if I have the ticket number as : 14876 then I need to get rowsstarting ticket number to totalall rows into a data table. { 3rd highlighted section}

If the ticket number is: 123456 then I need to get rows starting ticket number to total all rows in data table. {1st highlighted Section)

I am able to get the ticket number data row index using : lookupdatatable activity.
I need to get the total row index immediately after the corresponding ticket number.

How do I achieve this thankyou. attached a sample excel file below test.xlsx (9.3 KB)

dt.AsEnumerablw.Where(function(x) x(0).ToString.Equals("Total")).Select(function(x) dt.Rows.IndexOf(x)).ToArray() this will give the row numbers of all the total related rowsâ€¦

From the lookup table you know the start row numberâ€¦now find the closest total which is after the identified lookup rowâ€¦

then copy those rows to a separate datatableâ€¦dt.AsEnumerable.Where(function(x) dt.Rows.IndexOf(x) >= startRow AndAlso dt.Rows.IndexOf(x)<TotalArray.Where(function(x) startRow<x)(0)).CopyToDataTable

I have created a dictionary called as dt_dict which is of type <String, Datatable>will have your ticket number as key and The values below the ticket number row as datatable until a blank row is met