I have a CTE query. I have grouped everything in the WITH part. Then, down below, I am adding some calculated fields. Everything works fine. In one of the formula, I need to divide the value by the number of rows in the CTE result. This is where it gets confused.
What would be the best practice to achieve that?