Forum

Create 1 row for du...
 
Notifications
Clear all

Create 1 row for duplicate value

2 Posts
2 Users
0 Reactions
174 Views
(@jennifer-melindagmail-com)
Posts: 6
Active Member
Topic starter
 

Hello,

I'm wondering if there is a way to locate the duplicate ID's in column 2 and transpose the info from column A across the output to create 1 row per ID 

 

2022-05-04_14-28-56.png

 
Posted : 05/05/2022 5:31 pm
Riny van Eekelen
(@riny)
Posts: 1186
Member Moderator
 

May I assume that you are somewhat familiar with Power Query?

Let's say you have a table with two columns "Contact" and "ID", you would first group by ID without any form of aggregation. Then, add a custom columns that transpose the nested tables from the previous step and keep only the first rows for each of these. Remove the intermediate columns and expand the last one. A very crude working example is included in the attached file.

Beware. that the last step that expands "all columns" results in hard-coded column names, which isn't very useful if you don't know up front how many columns you need to expand. You could make it dynamic or you just go into the advanced editor, delete the Expand step and press the Expand button again to re-create the step with all columns that exist in the real data set.

Screenshot-2022-05-05-at-06.19.52.png

Edit: Replaced the attachment, now containing an alternative PQ solution.

 
Posted : 06/05/2022 12:20 am
Share: