I have data that has goes out to the right with Year columns. One record with many year columns. What I need is many records with one year column. I am trying to figure out if there is some way to 'automate' this process. Or at least a way to simplify the process. I have 30 columns of MaxofYear for each unique record (215 unique).
Original table:
ID MaxOf2014 MaxOf2013 MaxOf2012 MaxOf2011 MaxOf2010
2O001 -999 5 10 2 1
2O003 0 0 0 0 0
2O007 -999 -999 -999 -999 8
2O008 0 0 0 -999 0
2O011 -999 -999 -999 -999 -999
New Format:
ID Annual_Max Survey_Year
2O001 -999 2014
2O001 5 2013
2O001 10 2012
2O001 2 2011
2O001 1 2010
2O001 0 2009
2O001 5 2008
Original table:
ID MaxOf2014 MaxOf2013 MaxOf2012 MaxOf2011 MaxOf2010
2O001 -999 5 10 2 1
2O003 0 0 0 0 0
2O007 -999 -999 -999 -999 8
2O008 0 0 0 -999 0
2O011 -999 -999 -999 -999 -999
New Format:
ID Annual_Max Survey_Year
2O001 -999 2014
2O001 5 2013
2O001 10 2012
2O001 2 2011
2O001 1 2010
2O001 0 2009
2O001 5 2008