Given a big table, in which there are two important columns:
- nation code
- time
Name Nation code Time Other
a IT 2010 x
b DE 2011 y
c ES 2009 z
I want to construct another column using those two indicators to take the data from another table, which is built like the following
Nation code Y2009 Y2010 Y2011
DE 200 100 300
ES 100 150 350
GB 200 250 50
IT 50 150 100
The final result should be the following
Name Nation code Time Other NewColumn
a IT 2010 x 150
b DE 2011 y 300
c ES 2009 z 100