I don't know if this is useful to anyone, but I had a requirement where the startmonth had to be dynamic as the start month was different in different user cases. In this case having the solution in the script wouldn't work.
Using the example above, I created a master dimension called Contract Month (calculated dimension if in QlikView)
I useMonth Yearfield that is already stored but I sort by expression ascending using:
Mod(Month-$(vFM), 12)+1
I then create a drop down list that holds the variable $(vFM) and shows the months of the year with their corresponding month value (Jan (1), Feb (2) etc. ) and this control the beginning of the year.