My actual table is like this
enter image description here

My expected value is seems like this, i still confused

  1. how to fill the quarter with the previous quarter
  2. how to only took the latest class in quarter(quarter 1 only took ‘beginner to mid’)

enter image description here

I appreciate all of your help. Thank you!

2