Hi, thank you for your ideas.
But I think your solution would only work if the anchor query would select treemembers of level 1. Whereas my query starts with "where Green = 'Yes'" and these elements are in different levels. I have read that this should be possible with "window functions", but I can't find an example which works for me. Regards, Josef