Hello everyone,
I am trying to find an elegant solution to transform customer data table formatted in a single column as in the example below
| Customer no. | Contact type | Value |
| 123 | Email | abc@email.com |
| 123 | Email | def@email.com |
| 123 | Email | ghi@email.com |
| 123 | Phone | 111-111-111 |
| 123 | Phone | 222-222-222 |
| 123 | Phone | 777-777-777 |
| 456 | Email | jkl@email.com |
| 456 | Email | mno@email.com |
| 456 | Phone | 333-333-333 |
| 789 | Email | prs@email.com |
| 789 | Email | tuv@email.com |
| 789 | Email | wxy@email.com |
| 789 | Email | zzz@email.com |
| 789 | Phone | 444-444-444 |
| 789 | Phone | 555-555-555 |
| 789 | Phone | 666-666-666 |
to a new table where one customer record can hold up to two phone numbers and only one email address, as below
| Customer no. | Phone1 | Phone2 | Email |
| 123 | 111-111-111 | 222-222-222 | abc@email.com |
| 123 | 777-777-777 | | def@email.com |
| 123 | | | ghi@email.com |
| 456 | 333-333-333 | | jkl@email.com |
| 456 | | | mno@email.com |
| 789 | 444-444-444 | 555-555-555 | prs@email.com |
| 789 | 666-666-666 | | tuv@email.com |
| 789 | | | wxy@email.com |
| 789 | | | zzz@email.com |
Thanks in advance for help