Forum

Merge files and Rep...
 
Notifications
Clear all

Merge files and Replicate Multiple Records for Each Unique ID

4 Posts
2 Users
0 Reactions
78 Views
(@webbers)
Posts: 147
Estimable Member
Topic starter
 

I need to somehow create a new worksheet based on the two pieces of data I have.

My data_2396 sheet contains 31 records in my example  I need to have each of these 31 records displayed for each of the Document #s displayed on the DocID sheet, currently there are 14 in  my example.  So that would be a total of 31 x 14 records, or 434 records.  The document IDs are unique, however the 2396 records are not.  I have not been able to figure out how to get this data to merge based on these parameters.

 

Thanks,

Webbers

 
Posted : 04/12/2021 6:38 pm
Anders Sehlstedt
(@sehlsan)
Posts: 968
Prominent Member
 

Hello,

Something in line with this result perhaps?

In Power Query, add a custom column as a new step to your tbl_2396 query and add following formula:
= #"tbl_DocID"

This new step will have following code:
= Table.AddColumn(#"Changed Type", "Custom", each #"tbl_DocID")

Next step is to expand this new column, just ensure you have the Expand radio button ticked.

In attached file I had to load your tables as new queries in order to have something to play with.

Br,
Anders

 
Posted : 05/12/2021 6:27 am
(@webbers)
Posts: 147
Estimable Member
Topic starter
 

@Anders Sehlstedt,

Thank you so much!  I knew there had to be a way, but I simply could not figure it out.  I reviewed your example, and then applied the logic to a copy of m,y live data.  The live data shows 154712 rows, which is what I calculated it should based on the math ofd the # of documents times the # of records on my 2396 report.  Thanks again so very much!!!

 
Posted : 07/12/2021 11:34 am
Anders Sehlstedt
(@sehlsan)
Posts: 968
Prominent Member
 

Hello Sherry,

I am glad I could be of help. Sometimes we tend to miss the simple solutions just because we think it must be more difficult than so.

/Anders

 
Posted : 07/12/2021 5:01 pm
Share: