I have a table with a Flag column which can be true/false. I would like to group rows and calculate average of column Val as shown in the picture below:
Source table and Desired results

I have a table with a Flag column which can be true/false. I would like to group rows and calculate average of column Val as shown in the picture below:
Source table and Desired results
