No it's not the full script, just the part equivalent to the SQL. The T12 Table is deleted after the join. T12Months contains the 12 months for each [Snapshot Date]. The idea is to sum the [Position Management Fees] for each T12 for each month. The expected result is:
Client ID Snapshot Date T12 Fees 1 Jan 31 2015 456.42 1 Dec 31 2014 235.24
So basically, I need a T12 calculation for each entry in position_monthly_fact.