Forum Discussion
gancw1
3 years agoResolver II
Unpivot table
I have a quiz result in the following format Name id Q1 1 Q2 1 Staff A 102 TRUE 1 FALSE 0 Staff B 222 FALSE 0 FALSE 0 Staff C 312 TRUE 1 TRUE 1 How do I unp...
gancw1
3 years agoResolver II
My example was not very clear. The '1' label is the maximum score possible for the question and true or false answer does not equal to 1 or 0 score
Input
| Name | id | Q1 | Max Score | Q2 | Max Score |
| Staff A | 102 | A | 1 | C | 0 |
| Staff B | 222 | C | 0 | B | 1 |
| Staff C | 312 | B | 0 | A | 0 |
The desired output
| Name | id | Question | Ans | Score |
| Staff A | 102 | Q1 | A | 1 |
| Staff A | 102 | Q2 | C | 0 |
| Staff B | 222 | Q1 | C | 0 |
| Staff B | 222 | Q2 | B | 1 |
| Staff C | 312 | Q1 | B | 0 |
| Staff C | 312 | Q2 | A | 1 |