Combine tables using ETL inner join
Hi everyone,
I'm trying to combine two federated tables using the inner join in Magic ETL.
Both tables have over 9.5M rows but when I join them, the result is only 87K.
I tested the join in Snowflake and it resulted in 9.5M by the logic:
SELECT *
FROM 'A'
INNER JOIN 'B'
ON A.X = B.X
What could i be doing wrong?
*I'll need to join other tables after the join I mentioned above, in the same ETL
Answers
-
Here are a couple common issues with joins in Magic ETL
- It is case sensitive
- Leading or trailing spaces
An easy way to address both of these is to add a formula tile to each table prior to the join and use the following functions
UPPER() - converts the text field to uppercase
TRIM() - removes any leading or trailing spaces
You can do this in a single function like this TRIM(UPPER(fieldname))
Try doing this prior to your join and see if that works.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
Second what Mark said.
Also, for problem solving. I'd take a small sample of the ones that didn't join and compare them between the two tables. Will probably find what Mark said and there are some leading or trailing blank spaces or case sensitivity.
1 -
Thank you for help.
I tried to uso TRIM and UPPER and the matched rows jumped from 87K to 94k.
I inclued the REPLACE(fieldname, ' ', '') as well, to remove all leading spaces, so jumped to 134k.
It's far from the real match rows number, but looks like it is a format divergence.
Checking the data in the table I didn't see any different format, as shown in the image below:
0 -
Is it also possible that some of your rows don't have leading zeros and some do? If so, you can use the LPAD() function to add leading zeros if everything should be a certain number of characters.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.1 -
Have zeros completing the number, but they already come with.
I tried with LPAD() and the matched rows were reduce to 112k.
I don't know if it's related, but I brought the data from SAP by federated connection, so I created a view of this dataset.
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive