Merging two tables with two common dimensions

ratherbegliding

New Member
Joined
Sep 14, 2015
Messages
3
Dear all,

Greetings! This is my first post :)

So I'm having a problem but rather than get into a wordy explanation I'll just dive into a basic example.

Think fishing trips.

In table 1 we have:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Trip No[/TD]
[TD]Species[/TD]
[TD]No of fish[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]TUNA[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]HAKE[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]COD[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]TUNA[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]COD[/TD]
[TD]20[/TD]
[/TR]
</tbody>[/TABLE]


Then in table 2 we have the weights caught:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Trip No[/TD]
[TD]Species[/TD]
[TD]KG[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]TUNA[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]HAKE[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]COD[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]TUNA[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]COD[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]


So each combination of Trip No and Species has a specific value in each table.
What I'm trying to achieve is a combined table like this:

[TABLE="width: 500"]
<tbody>[TR]
[TD]Trip No[/TD]
[TD]Species[/TD]
[TD]No of fish[/TD]
[TD]KG[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]TUNA[/TD]
[TD]5[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]HAKE[/TD]
[TD]10[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]FT001[/TD]
[TD]COD[/TD]
[TD]20[/TD]
[TD]10[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]TUNA[/TD]
[TD]10[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]FT002[/TD]
[TD]COD[/TD]
[TD]20[/TD]
[TD]12[/TD]
[/TR]
</tbody>[/TABLE]



I've been trying to do this with Power Pivot but I keep running into problems with the many to many type relationship of each dimension, getting the message:

'The relationship cannot be created because each column contains duplicate values. Select at least one column that contains only unique values.'

every time I try to make connections between the tables. I've tried to use bridging tables such as a table with just species and another with just unique, sequential trip no's but haven't managed to get the relationships to work.

Does anyone have any suggestions how to do this in Power Pivot?
Using Excel 2010.

Thanks,

RBG
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I would suggest you created a 'joined' table using Power Query and load the resulting table to Power Pivot (free add-in for Excel 2010 if you haven't already installed it).
You can create queries for the two original tables, then use Power Query's Merge function (which creates a join between the tables) where you can select matching columns from each table.
 
Upvote 0

Forum statistics

Threads
1,224,120
Messages
6,176,495
Members
452,733
Latest member
Gao87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top