Ben,
A super article and thanks ever so much. I would also recommend that folks have a look at similar techniques done by Jacob Sebastian. This series of recursion articles(cte) is second to none. I implemented the technique at a client site a few years back. The clients were thrilled.
For those of you in the financial world, Jacob's techniques are first class for composite funds.