2024 Oct 11 12:47 PM
We have the following data action to make a forecast for the next remaining months based on the index of the previous months. The index is calculated on past months. This index is used for the calculation of the future months. The below script will calculate the specific "PERIOD_FORECAST" (for example period 10 or 11 or 12) by multiplying the Budget for period 10 times the calculated index over the past 9 periods:
We would like to avoid the hard coded "2023xx" and replace it with a flexible solution
Thanks a lot for this very usefull information. Would it be possible to make the "9" in the code also as a parameter to make it flexible ? In the next month it should then be "10". Many Thanks !
2024 Oct 12 9:04 AM
Maybe you can try with something like this:
MEMBERSET [d/Date] = PREVIOUS(9,"MONTH", %PERIOD_FORECAST%) TO %PERIOD_FORECAST%
MEMBERSET ...
VARIABLEMEMBER #PERIOD_VERSIE OF [d/Date]
VARIABLEMEMBER #PERIOD_VERSIE_VERGELIJK OF [d/Date]
DATA([d/Date] = #PERIOD_VERSIE) = RESULTLOOKUP([d/Version] = %BASELINE_INDEX_VERSIE%)
DATA([d/Date] = #PERIOD_VERSIE_VERGELIJK) = RESULTLOOKUP([d/Version] = %BASELINE_INDEX_VERSIE_VERGELIJK%)
DATA( [d/Date] = %PERIOD_FORECAST%) = RESULTLOOKUP([d/Date] = #PERIOD_VERSIE)/RESULTLOOKUP([d/Date] = #PERIOD_VERSIE_VERGELIJK)
2024 Oct 14 7:55 AM
Thanks a lot for this very usefull information. Would it be possible to make the "9" in the code also as a parameter to make it flexible ? In the next month it should then be "10". Many Thanks !
2024 Oct 14 8:25 AM
of course, you can make it as parameter as well if needed.