Forum Discussion
Relationship between two tables
so if customer orders product m123 x 3, then automatically product m123 with it standard accessories are x 3,
you need a uniquekey for each combination of product and accessory.
for example
you could take the combination of main product and accessory together that make a pack in a table and assign a unique id to each unique combination then under client you could use id that rather than the main product to join on
just depends on how far you want to go to model this data.
Hi vanessafvg
I re-read your first answer, I could use a unique ID for each combination, however I can't use it in my customer table since I don't have two columns "Main product" and "accessory" like my product table, I have only one column gathering them all.
- vanessafvg3 years agoCommunity Champion
there are several ways to tackle this but it would be easy to do it with sample data, if you could share some sample data in text form, i could pull something together in a power bi model to show you how you could do it. preferably if you are able to share your file that would be the most ideal.
what i am thinking is potentially you could create, as you have a bridge table and in that bridge table you would have a new column which could be an id that groups products together and then the column of the actual product code. howvever its much easier to assess this when i can actually see the data in your model.
also how do you currently know what products are grouped together?
- Medmbchr3 years agoHelper IV
Hi
The first table is my actual combination, this is just a sample to help out understand the problem without sharing customer data.
The bridge entity that I made is just an idea, but not part of the model itself, it's a list of all distinct products.
One other way to look at that first table is to gather all products in the same column and add a new column identifying either main product or accessory.