Hello,
I have the following data:
Year
Date of Forcast
Forecast Value
2018
20171102
0.65
2018
20180227
0.63
2018
20180509
0.64
2018
20180730
0.66
2018
20181110
0.69
2019
20190308
0.73
2019
20190509
0.52
2019
20190806
0.49
2019
20191108
0.49
The first row, for example, states that the earning forecast for the year 2018 is 0.65 and this forecast was given on the second of August 2017.
The second-row state that the forecast for the year 2018 was updated on the 27th of February 2018 to the value of 0.63.
I want to write a code that will take the latest forecast value for each year as long as the "date of forecast" is not later than the 31 of March of the same year.
For example for the first 5 rows (which all refer to the year 2018), the new variable (called "updated value") will be equal to 0.63.
For the next 4 rows (which all refer to the year 2019) the new variable will be equal to 0.73.
Could anyone assist in writing the code?
Thank you,
Lior
... View more