Hello,
I need to return in the wanted column, the maximum value for the prb2 variable, in the previous 365 days from the ddate column
In the example 40.4959 is returned as it is the highest prb2 value in the previous 365 days.
The countback should not include the prb2 for the current date i.e do not include the prb2 for 12-Oct-20, only the 365 days previous to this date should be looked at
Thank you,
Hans
I need to return in the wanted column, the maximum value for the prb2 variable, in the previous 365 days from the ddate column
In the example 40.4959 is returned as it is the highest prb2 value in the previous 365 days.
The countback should not include the prb2 for the current date i.e do not include the prb2 for 12-Oct-20, only the 365 days previous to this date should be looked at
Thank you,
Hans
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str9 ddate float(prb2 wanted) "06-May-19" 25 . "12-Jun-19" 25 . "10-Jul-19" 82.6446 . "01-Aug-19" 81 . "17-Aug-19" 32.6531 . "28-Aug-19" 25 . "13-Sep-19" 100 . "29-Sep-19" 56.25 . "01-Nov-19" 2.7778 . "19-Nov-19" 2.3669 . "04-Jun-20" 0 . "13-Jul-20" 2.3669 . "22-Aug-20" 40.4959 . "31-Aug-20" 19.7531 . "12-Oct-20" 12.7551 40.4959 end

Comment