Hi, I am trying to achieve the following:
Copy values of “Plan” item to “Revised Plan” item (model is attached). The script should take given particular year and month and apply to this year and this months plus future months. It is easier to do it for particular matrix, but the idea is having script which goes through all matrices and if there is an item “Plan” copy it values to “Revised Plan” for a given year and months onward. It should skip matrices where those items do not exist. Any advice is appreciated.
After extensive reading, learning and trying I have figured out how to write this script. If anyone interested in accessing items and categories across the whole model via script with dynamic input, please see attached model.
monthsineed = |Selector::MonthStart|.value + “..” + |Selector::MonthEnd|.value
itemineed = |Selector::Itemneeded|.value + “:”
itemdestination = |Selector::Itemwheretoput|.value + “:”
yearineed = |Selector::Yearneeded|.value + “:”
fg = model.matrices[it].getSelection(yearineed+itemineed+monthsineed)
gh = model.matrices[it].getSelection(yearineed+itemdestination+monthsineed)
gh.values = fg.values