Extracting specific rows from data table: "Source contains no data rows"

Hi everyone,

I hope someone can help me out with this.

I have a task where I have to extract some specific data rows from a data table. I’m trying to extract the rows by way of two indexes with this assign act:

MyVar = dT1.asenumerable.take(index1 - index2).copytodatatable

When I get to the activity, I get the error message that the ‘source contains no data rows’, although I know that the data table I’m trying to extract from contains data. I’m not sure if the structure of the source table has anything to do with it. It looks something like this when written to Excel:

|Name |Title Title Title Title
| |Text Text Text Text
| |Text Text Text Text
| |Text Text Text Text
| |Text Text Text Text
| |Text Text Text Text
|Name |Title Title Title Title

So the first row under the cell containing (Name) is empty, and I’m trying to extract everything between the first row (it included) and the next row beginning with (Name). I’m wondering if the extraction fails because of the empty rows?

Thank you in advance.

welcome to the forum

ensure index1-index2 is a positive integer. Maybe you should swap it to index2-index1


It just occurred to me that index 1 is 0 in this case, which I can see after googling is a ‘neutral’ integer - could this be the reason?

can you show us on how you implemented the index retrieval?

maybe you can also rework the sample data to elaborate your case. But we do have a feeling that you are close to the solution

I can’t show it right now since the appropriate workflow and data are on my work laptop, which I don’t have at the moment.

I’ll try to explain, but it gets slightly complicated.

There is an original Excel sheet which I put into a data table (DT1) while deleting a number of rows at the top and at the bottom.

From DT1 I extract all rows in column ‘A’ which are not empty - the rows I’m interested in here contain a name, in this case. These rows from column ‘A’ containing a name are stored in a new data table (DT2) along with a second column which contain the index number corresponding to the row where the name was found. DT2 thus contains two columns:

Name Index
(Name1) (Index1)
(Name2) (Index2)
(Name3) (Index3)
(Name4) (Index4)

So far, this works as intended.

Now I want to use that information to extract a third data table (DT3) containing information found in rows between specific rows in DT1 (to begin with between rows 1 and 12, which correspond to indexes 0 - 11, since row indexes are base-zero in Excel).