Report Script Nested Query

Need some help/clarification with accessing data in a nested query. I’ve read through the manual and this post: Report Script Using Nested Query, however I’m thinking either I’m doing something incorrect.

If you have the following:

Query
   |-Nested Query 1
      |-Nested Query A
      |-Nested Query B

If I get the .getCoreResults() for Nested Query 1, I get the results of the query in a dataset. If I then call .getNestedQueryResults() for Nested Query A I get all the results of Nested Query A.

Is there any way in loop through Nested Query 1 and only get the associated nested query results from Nested Query A and B for the result row I’m currently looping through? I need to loop through Nested A and know when row from Nested Query 1 it is associated with so I can make sure that I’m grabbing the right information to associate with this data.

Why can you not get them both and then loop?

I guess that is what I can’t seem to figure out how to do.

I can’t seem to access the nested query results for Nested Query A or Nested Query B until I’m looping through Nested Query 1.

And then I’m still not sure that will get me what I need.

What I need to do is get the query results for Nested Query 1, and then loop through those results and only get the nested query results that pertain to the row I’m on.