I am trying to calculate the YTD value for every month. How could I achieve this in SQL Server?
Green is how my data looks in the table.I am suppose to calculate the one in Yellow. Your help will be much appreciated.
Year Month Monthly_Score N_size YTD_Score
2017 1 70 10 70*10/10
2017 2 80 20 70*10/(10+20) + 80 *20 /(10+20)
2017 3 90 30 70*10/(10+20+30) + 80 * 20 /(10+20+30)
+90*30/(10+20+30)