I have this bit of postgres code for which I use a couple of CTE\'s for dimensions and fact calculation for one ID to get into a final xml one line result, how can I adjust th