Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: mwillettHi there,
I have data that reads across like this:
ID, ValA1, ValA2, ValB1, ValB2, etc (for about 100 Vals)
1,3,Y,2,N
2,2,Y,,
3,,,1,,
The data is relatively sparse in that the for any one ID (i.e. row), only a few of the Values may be populated with a value. I haven't shown this in the sample data but you could imagine that all other values may not be populated.
I would like to change the structure of the data so that it looks like this:
ID, ValName, Value1, Value2
1,A,3,Y
1,B,2,N
2,A,2,Y
3,B,1,NULL
Is this possible noting I am hoping to extract the value in the ValName field directly from the original field name; and would want a new record created if either of the values has something captured.
Mike