How to add a cross apply to a BAQ

This can be done in a CTE as well.

check out the baq in this post.