Good morning,
I start with 3 columns on my datasheet.
In column 4 the maximum value of column 2, for the previous 365 days is calculated using...
rangestat (max) max_figure1_1year = figure1, int(ddate -365 -1)
Column 5 is where I need help...
I need column 5 to return the value in column 3 that is adjacent to the calculated figure in column 4
For example column 4 returns 74 (the maximum value of column 2 in the previous 365 days, column 5 returns 70 (the adjacent value from column 3)
If there are joint maximum values for the previous 365 days, as is the case in the second example, then the highest adjacent value is returned (here 84 was the maximum value observed twice, so the value returned in column 5 is 82, as it is the highest adjacent value.
Hope that makes sense. Thanks.
I start with 3 columns on my datasheet.
In column 4 the maximum value of column 2, for the previous 365 days is calculated using...
rangestat (max) max_figure1_1year = figure1, int(ddate -365 -1)
Column 5 is where I need help...
I need column 5 to return the value in column 3 that is adjacent to the calculated figure in column 4
For example column 4 returns 74 (the maximum value of column 2 in the previous 365 days, column 5 returns 70 (the adjacent value from column 3)
If there are joint maximum values for the previous 365 days, as is the case in the second example, then the highest adjacent value is returned (here 84 was the maximum value observed twice, so the value returned in column 5 is 82, as it is the highest adjacent value.
Hope that makes sense. Thanks.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float ddate byte(figure1 figure2) double max_figure1_1year float figure1_neighbour 22200 46 68 74 70 22158 74 70 84 82 22149 70 72 86 . 22109 54 77 86 . 22070 25 78 86 . 21872 72 80 86 . 21854 28 81 86 . 21821 84 82 86 . 21805 84 77 86 . 21789 86 78 84 . 21778 81 78 86 . 21762 82 78 86 . 21740 84 76 86 . 21712 66 78 86 . 21675 83 79 86 . 21479 76 80 86 . 21448 84 81 86 . 21423 86 76 90 . 21414 71 79 90 . 21404 80 80 90 . 21376 86 80 90 . 21336 77 82 90 . 21332 85 83 90 . 21304 83 81 96 . 21295 54 82 96 . 21268 86 82 96 . 21110 65 84 96 . 21089 79 86 96 . 21077 90 87 96 . 21000 88 88 96 . 20992 89 88 96 . 20958 96 83 91 . 20940 72 84 91 . 20748 85 84 91 . 20732 91 83 87 . 20664 63 85 87 . 20595 70 87 87 . 20578 78 87 87 . 20556 87 84 . . end format %td ddate

Comment