Using 'member index' within a grafted list

Hi All,

Interesting one here from my perspective, something I have been curious about for a while.

I am trying to use ‘create set’ and then ‘member index’ within a list which is not flattened. However, the results come back with a list that I am struggling to understand. In the attachment image ‘list’. You can see 29172 variables. And then I see {0;0;0;0} and this is what I’m a little confused by.

It’s like a list within a list which is what I want. But how do I only flatten say {0;0;0} this part of the list and not the whole thing?

Sorry if this is a little confusing, but in my script, I show an example of it working for one grid cell. The end goal is to find total numbers of tree species over 5% within all the grid cells. But when I try to do the same for the rest of the grids, it doesn’t work.

Create set and member index works

well for (433.3 KB)

I think something to do with shift paths is what I’m after, but for multiple branches

Got it working with shift paths. Got list length after member index, then shifted the list back.