I am new to gooddata and I am struggling to achiev...
# gooddata-platform
e
I am new to gooddata and I am struggling to achieve the following: I have two sql tables: Table A has two columns "Name", "ID". Table B has two columns "Title", "ID". (They are actually more complicated than that but this is what counts). "ID" is not unique in Table A and it's not a key. I need to create a filter to show all the Names from Table A and then select only rows from Table B that match the "ID" from table A. If I try to link Table A and B in the Data tab I get the error "Mapping not set" for the column "Name" because there's no column Name in table B. Sorry it must be a naive question, but cannot find a way around it nor documentation to answer it. Thanks so much for your help. If anybody here freelances I'd be also happy to hire you for assistance.
j
Hello Emma, Correct me if I am wrong, but I believe you are using the cloud trial version, is that correct? If so, could you please post in the #gooddata-cloud channel? Nevertheless, if you are trying to connect datasets using MAQL, you can do so by using the by clause. If this doesn't help could you please provide a screenshot of your LDM and the metrics you are working with?
j
Hi Emma, is ID primary key in the table B? If it is the case you should drag connection from the table B where the ID is primary key to table A. The arrow of 1:N relation shall point from dataset with lower number of records (1) to dataset with more records (N).
Or is it the case that there is many to many relationship between Name and Title?
p
🎉 New note created.
e
Thanks for your replies. The ID is a primary key in table B. However, in table A, it's not. In other words table A has rows where the ID appears multiple times. But in Table B the ID appears just once. I have tried connecting the tables. If I try to map table A to table B I get the error: "source columns not found in data source" because table A has 5-6 columns, and only 1 has the column ID which maps to Table B, while the other columns don't. But there's no way for me to link based on a specific ID... or is there? really don't know what to do
j
You need to drag relation from table B where ID is a primary key to table A where ID is foreign key and the relation will be created successfully in case the fields are named the same in both datasets as shown in video: https://www.loom.com/share/f348d1100cd3491c88842fcaf88df490?sid=216c5dda-b55f-4d6a-9e4b-3cb6ee56bbf2.
In case the field in table A is called differently or ID attribute was deleted by some previous attempts to connect datasets, you can create it as new field. Pay attention to the warnings in the right panel. They may indicate some problems in data model, for example missing mapping of reference to physical column in a table. This can be corrected in dataset details->Data mapping tab.