Selecting (n) items from each branch of a tree

Hello fellow hoppers! Question here. I have fairly simple question. I want to make random selection of (n) numbers from each branch of data tree. How can I achieve that? I’m guessing there is a known method but I could not figure it out on my own other than the way in the attached file, which is ugly. Came here to seek some help, thanks in advance. (26.5 KB)

Here is a way with Random Reduce logic. (17.7 KB)

Thanks Mike, but I need to keep the same number of branches and remove (or select) a constant number from each branch. Something like this, just maybe a little nicer and scale-able… (19.7 KB)

Blah… The branch count was my stupid mistake not paying attention, here is that fixed. (16.2 KB)

remove (or select) a constant number from each branch.

That is a lot easier, just be aware of your branch lengths, if they vary you may hit zero on some. (13.1 KB)

and if you want to remove a different pre-defined amount from each branch just use a list of values grafted into Random Reduces R input.

1 Like

You’re the boss, @Michael_Pryor, thought I was going crazy for a sec… will watch for those branch lengths, thanks again!

I have a question which I think it’s related to this topic.
I wanna dived list “A” to the values of the list “B” and I need to repeat values of list “A” in each branch according the attached pic.

Already answered to your same question in another post…


And here’s another way using Stack Data.


thanks, it’s clear