Forum Discussion
Anonymous
6 years agoNot applicable
Join tables with two keys
Hi Guys, I hope you can help me with the problem I'm facing. I have two tables, let's say Contract and Revenue. Revenue | Customernr. | Subcategory | Subcategory (Groups) | Revenue in € | ...
- Anonymous6 years ago
I figured it out with the replies on this post.
I could not create a composite key in the query editor, because I have groups.
So I created a new column in both tables that uses the two columns and merges them as one. This is my key.
Now I could create a relationship between the two tables.
IanCockcroft
Post Patron
6 years agoHi Tim, can you not create a compcite key in the query editor uing the two fields and then join the tables on the composite key?
something like this
| Revenue | ||||
| Customernr | Subcategory | Subcategory (Groups) | Revenue in E | composite key |
| 1 | Blue Paint | Paint | € 40 | 1 Paint |
| 1 | Red Paint | Paint | € 50 | 1 Paint |
| 2 | Planks | Wood | € 170 | 2 Wood |
| Contract | ||||
| Customernr | Category | Amount in eur | composite key | |
| 1 | Paint | € 100 | 1 Paint | |
| 1 | Metal | € 250 | 1 Metal | |
| 1 | Wood | € 200 | 1 Wood | |
| 2 | Paint | € 500 | 2 Paint | |
| 2 | Metal | € 250 | 2 Metal | |
| 2 | Wood | € 200 | 2 Wood |