Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ba11
Contributor III
Contributor III

Add values from one table to another

Hello everyone,

I have table A (Operation) and table B (PART_SITE). There are values in table A that I'd like to add to table B, note that table A and B have no values in common and are not connected to each other. I've tried concatenating, mapping and a left join but non seemed to have worked or perhaps I haven't done it correctly.  Any insight will be greatly appreciated. 

Labels (1)
1 Solution

Accepted Solutions
steeefan
Luminary
Luminary

If you do not need the values from the two tables on the same row, which I'm guessing based on the fact that there are no values in common, you should either not do this operation or perform a CONCATENATE LOAD. This will combine your two tables into one.

View solution in original post

13 Replies
rubenmarin

Hi, if there are no common values you can only do an outer join, wich will make a combination of all rows of table A and all rows of table B. Otherwise, how do you want to choose wich rows of table A will go to each row of table B?

ba11
Contributor III
Contributor III
Author

Didn't want to do that as it'll make the tables too large and slow things down.

steeefan
Luminary
Luminary

If you do not need the values from the two tables on the same row, which I'm guessing based on the fact that there are no values in common, you should either not do this operation or perform a CONCATENATE LOAD. This will combine your two tables into one.

rubenmarin

And about the other question?: how do you want to choose wich rows of table A will go to each row of table B?

It will be better if you add a sample of table A and Table B and how you expect to be in the end.

Aasir
Creator III
Creator III

Modify this

// Load data from PART_SITE
PART_SITE:
LOAD
ID,
Site,
// other fields from PART_SITE
FROM [your PART_SITE source];

// Mapping Load to add values from Operation to PART_SITE
MappingLoad
ID as OperationID,
OperationField1,
OperationField2,
// other fields from Operation
FROM [your Operation source];

// Apply the mapping to PART_SITE
PART_SITE:
LOAD
ID,
Site,
// other fields from PART_SITE
ApplyMap('YourMappingName', ID) as OperationField1,
ApplyMap('YourMappingName', ID) as OperationField2,
// other fields from PART_SITE
FROM [your PART_SITE source];

ba11
Contributor III
Contributor III
Author

Thought a mapping table can only have two fields?

ba11
Contributor III
Contributor III
Author

I have an existing chart in my app that I'm trying to add a calculated field from the OPERATIONS table to, but the chart breaks when I try to do this which is why I'm looking for alternatives on hoe to add the field.

steeefan
Luminary
Luminary

I'm assuming that the existing chart then contains data from your PART_SITE table.

You should not have data from two separate tables that are not connected in any way in one chart.

Also, yes: A mapping table can only have two fields.

Aasir
Creator III
Creator III

Nope.