zenith1107
Technical User
Hi, I have a dataset as follows and I need to retrieve two things: 1) the sum of VALUE between (date-1) and (date-3) for each date and 2) whether, during the 5 days, there are >= two days where the VALUE is 0. I think PROC SQL should be used but I'm not sure how to implement this.
INPUT DATASET:
ID DATE VALUE
1 20110101 0
1 20110102 0
1 20110103 1
1 20110104 2
2 20110101 1
2 20110102 2
2 20110103 3
2 20110104 4
Output should be 1) 1 (0+0+1) for ID1, 20110104 and 6 (1+2+3) for ID2, 20110104. and 2) a mark for ID1, 20110104, since there are 2 days with a value of 0 during the 3-day window.
Any help is greatly appreciated!
INPUT DATASET:
ID DATE VALUE
1 20110101 0
1 20110102 0
1 20110103 1
1 20110104 2
2 20110101 1
2 20110102 2
2 20110103 3
2 20110104 4
Output should be 1) 1 (0+0+1) for ID1, 20110104 and 6 (1+2+3) for ID2, 20110104. and 2) a mark for ID1, 20110104, since there are 2 days with a value of 0 during the 3-day window.
Any help is greatly appreciated!