Lars Breddemann - In my opinion it's still fair to follow the "old adage" of not mixing CE functions and SQL syntax in SQLScript. Sure, they both execute in column store, but as I understand, the code will be parsed into SQL nodes, CE nodes, optimize each accordingly, and then combine results - instead of "full" optimization across all code via either SQL optimizer or CalcEngine optimizer.
From my experience, it's a mixed bag - depending on complexity, data volumes etc - sometimes mixing slows it down, and other times it's almost same performance as pure CE functions or pure SQL. So, governing rule - generally avoid mixing due to uncertain performance impact.
In any case, back to the original problem Felix - I believe you could still accomplish this using Lars' code but in CE functions. You'd join on username via CE_JOIN (bit of a cross join), and then in CE_PROJECTION you'd add in filters that satisfy the additional join conditions.
Cross join sounds expensive, but I've found to be a great trick for accomplish rather odd logic with good performance (you can check out my document on efficient cross/theta joins using CE_JOIN as well as Abani Pattanayak's write-up on efficient time-based reporting for examples of leveraging cross joings). Just a thought.
Links to those docs: