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
Hi SAU. I meant from May 2019 until the end of the year. There are many matrices and many model templates where this operations is required. Those are all assumptions which should be simply populated again. Manually it would take a long time. Exactly I would like to copy “Plan” item values from May 2019 to Dec 2019 and paste to “Revised Plan” item values May 2019 to Dec 2019 in all matrices with one script.