Hi GD team, assuming that I have a table with 2 ID...
# gd-beginners
a
Hi GD team, assuming that I have a table with 2 ID columns. I'd like to map these 2 columns to the same table, is this feasible? Thanks!
m
Hi Alson, you can map two different ID columns from the same table to a single dataset by creating two separate relationships in the Logical Data Model. For example, if you have an Orders table with
buyer_id
and
seller_id
, both linking to a Users dataset, you could create two different connections - one as “Buyer” and another as “Seller.” This would ensures that both IDs correctly relate to the Users dataset and having a distinct relationships.
a
Thank you for your reply @Michael Ullock, yes this is indeed the kind of relationships I want to have 😄 ok let me try it out!
Hello @Michael Ullock you dont mean this method right? I want to try to map to the
id
field in the other dataset, but after selecting it for the 1st one, I cant use it for the 2nd time
Alternatively, I tried to "drag" and create another arrow, but this arrow would not materialise to a popup asking me to create a relationship
Sorry this is kinda urgent but could you let me know please? Thank you
Hello could anyone pls assist on the above enquiry pls?
i
Hi @Alson Yap, Each dataset can have only one connection point(primary key) with possibility of multiple reference keys, if this is what you were asking about. You can find more details here and some hints about advanced modeling and many-to-many relationships can be found in this article. Please let us know if there is anything unclear.
a
Hi @Ivana Gasparekova thank you for getting back. I am a little confused, does Michael's advice still hold true? My ideal vision is exactly what he has proposed
Hello @Ivana Gasparekova sorry could you please clarify the above?
m
Hi Alson, sorry for the delay in getting back to you here. Perhaps there was some confusion on my part from your initial question. But now I see your screenshot and what you’re reffering to in this case, I would like to reiterate what my colleague Ivana mentioned, that you can have only one primary key per dataset, but you can have multiple other datasets in the LDM with references to that primary key. Any single reference in a dataset can point back to only one primary key. More details on the primary key can be found here: https://www.gooddata.com/docs/cloud/model-data/concepts/primary-key/