Hi,
I need to find a code for the date1 closest to my date2 (all the same date) all of which belong to the same ID, and use the value for that closest date. The data somewhat looks as follows:
ID Date1 Date2 Value
1 augst1 august2 45
1 august13 august2 56
1 august 25 august2 34
1 august31 august2 56
So in the case described above I want to work with:
ID Date1 Date2 Value
1 augst1 august2 45
Because august1 is closest to august2.
I need to do this for 8000 ID's. So I am looking for a code to do this.
Appreciate the help!
I need to find a code for the date1 closest to my date2 (all the same date) all of which belong to the same ID, and use the value for that closest date. The data somewhat looks as follows:
ID Date1 Date2 Value
1 augst1 august2 45
1 august13 august2 56
1 august 25 august2 34
1 august31 august2 56
So in the case described above I want to work with:
ID Date1 Date2 Value
1 augst1 august2 45
Because august1 is closest to august2.
I need to do this for 8000 ID's. So I am looking for a code to do this.
Appreciate the help!