I have a table that looks like
Test Reader Result
1 John 1.6
1 Jack 5.2
2 Ursula 2.5
3 Albert 3.0
2 Jack 5.1
And I know each test can have a maximum of 3 Readers
so I want to create a table that looks like
Test Reader_1 Result_1 Reader_2 Result_2 Reader_3 Result_3
1 John 1.6 Jack 5.2 (null) (null)
2 Ursula 2.5 Jack 5.1 (null) (null)
3 Albert 3.0 (null) (null) (null) (null)
I looked around and it seems I need to use a PIVOT table. The only problem is that I found examples where an ordinal variable is used to create the columns. In this case case I have a predefined number of possible columns (3). Any ideas?
See Question&Answers more detail:os