Group following rows using only one flag

Viewed 53

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

1 Answers
Related