Two things :
- first, what you try to do here is totally different from what you ask in this topic. Right ?
- then, finally, what you ask is precisely answered in this topic : Aggregate fields based on nested filter with custom separator
Why don't you use the solution I provided to you here ?