I'm not really sure how to do this. I would really appreciate the help (as always!)
Also, it should be noted that the values can be carried through (i.e. droughtyears04 doesn't necessarily need to be missing for years other than 2004).
region_id | region_name | drought | year | droughtyears04 | droughtyears05 | droughtyears06 | droughtyears07 |
1000 | Vellore | 0 | 1997 | ||||
1000 | Vellore | 1 | 1998 | ||||
1000 | Vellore | 0 | 1999 | ||||
1000 | Vellore | 0 | 2000 | ||||
1000 | Vellore | 1 | 2001 | ||||
1000 | Vellore | 1 | 2002 | ||||
1000 | Vellore | 0 | 2003 | ||||
1000 | Vellore | 0 | 2004 | 3 | |||
1000 | Vellore | 1 | 2005 | 3 | |||
1000 | Vellore | 0 | 2006 | 3 | |||
1000 | Vellore | 1 | 2007 | 3 | |||
254 | Faizabad | 1 | 1997 | ||||
254 | Faizabad | 1 | 1998 | ||||
254 | Faizabad | 0 | 1999 | ||||
254 | Faizabad | 0 | 2000 | ||||
254 | Faizabad | 0 | 2001 | ||||
254 | Faizabad | 1 | 2002 | ||||
254 | Faizabad | 1 | 2003 | ||||
254 | Faizabad | 0 | 2004 | 4 | |||
254 | Faizabad | 1 | 2005 | 3 | |||
254 | Faizabad | 0 | 2006 | 3 | |||
254 | Faizabad | 1 | 2007 | 3 | |||
256 | Farrukhabad | 1 | 1997 | ||||
256 | Farrukhabad | 1 | 1998 | ||||
256 | Farrukhabad | 1 | 1999 | ||||
256 | Farrukhabad | 0 | 2000 | ||||
256 | Farrukhabad | 1 | 2001 | ||||
256 | Farrukhabad | 1 | 2002 | ||||
256 | Farrukhabad | 0 | 2003 | ||||
256 | Farrukhabad | 0 | 2004 | 5 | |||
256 | Farrukhabad | 1 | 2005 | 4 | |||
256 | Farrukhabad | 0 | 2006 | 4 | |||
256 | Farrukhabad | 1 | 2007 | 3 |
0 Response to Count drought years for previous 7 years, by group
Post a Comment