Hi there! I'm new to GoodData and I'm working on b...
# gd-beginners
r
Hi there! I'm new to GoodData and I'm working on building my data model. I've run into a bit of a snag and could use some help. Here's what I'm dealing with: I have two tables in my model: 1. A Profile table with fields like Profile ID, Profile Name, and some other stuff. 2. A Tasks table with fields including created_by_id, created_for_id, and assigned_to_id. These are all supposed to link back to the Profile ID in the first table. The problem I'm having is that when I try to map these relationships, GoodData only lets me connect the Profile ID to one of the fields from the Tasks table. What I'm wondering is: Is there some way I can map all three of those fields from the Tasks table (created_by_id, created_for_id, and assigned_to_id) to the Profile ID? I feel like I must be missing something obvious, but I can't figure it out. Any ideas? Thanks in advance for your help!
m
Hi Rujuta, welcome! I recommend looking into setting an M:N relationship in your LDM, if I understand your use case correctly: https://www.gooddata.com/docs/cloud/model-data/evolve-your-model/many-to-many-in-ldm/#Many-to-ManyinLogicalDataModels-SetupMNrelationshipsinLDM This will allow you to create connections between the dataset objects as desired.
r
Thank you for your response. While I understand the concept of M:N relationships and bridge tables, it doesn't directly address my specific question. I'm still unable to map multiple fields from one table (e.g., created_by_id, created_for_id, assigned_to_id) to a single field in another table (Profile ID). I'm looking for a way to establish this connection without creating an additional table. Is there a workaround or alternative method that would allow me to achieve this mapping directly?
m
Are you looking for referencing those attributes to the Profile ID dataset? If so, defining a primary key in the dataset and then connecting the dataset to Profile ID will allow you to work with the attributes in question, there is no need to map them any other way. I recommend looking into the tips here which highlight the best practices for building your LDM: https://university.gooddata.com/tutorials/data-modeling/logical-data-model-five-pro-tips-for-data-modelling/
r
I think I'm unclear about how creating a new key might help. Just to clarify my question, I have two tables in my database, called "transaction" and "profile". I need to link the "profile ID" to two of the columns in the "transaction" table, called "recipient ID" and "issuer ID". I want to pull the profile names in my reports associated with each recipient ID and issuer ID respectively. I need to know how I can do the mapping so that I can pull these values in my report. I have attached the two tables that I need mapped.
s
@Moises Morales a transaction has both an issuer id (the person that issued the transaction) and a recipient id (the person that was billed for the transaction). both of these fields link to a profile in our system. we need to map both of those ids (issuer id and recipient id) to the profile model; what would creating a new field called “profile id” in transactions do? what would it map to & refer to?
m
Hi Sasha and Rujuta, the Profile dataset would need to be referenced in the Transaction dataset, otherwise slicing for example the Transaction ID by Profile name will not be possible. From the screenshot you have shared, I see this has not been done yet. Please keep in mind that when you are looking at the LDM in GoodData, the direction of the arrows (references) is very important. When building the metrics and insights later on, you will be able to filter by anything which is either in the same dataset OR in a dataset which is connected against the direction of the arrow. I recommend revisiting your LDM design based on the above.