How to merge duplicate rows when with same ID with different data

41 views Asked by At

I have a data table that looks like this:

ID Participação Pessoa
01 Comunicante Lucas
01 Vitima Lucas
02 Comunicante Rafa
02 Vitima Vitor

I want to look like this:

ID Comunicante Vítima
01 Lucas Lucas
02 Rafa Vitor

Sometimes Comunicante is different from Vítima because of this I don't want to merge comunicante,vitima. I want them in separate columns.

This was so far I made:

ID Comunicante Vítima
01 Lucas
01 Lucas
02 Rafa
02 Vitor
1

There are 1 answers

0
b2m On

The concept you are looking for is called Tranposing in OpenRefine.

Starting from your first table go to the column menu on "Participação" => "Transpose" => "Columnize by key/value columns…". In the following dialog use "Participação" as "Key Column" and "Pessoa" as "Value Column".

Columnize by Key/Value Columns dialog in OpenRefine

The result should look like your desired table.