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 toany 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 toany 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.9K Product Ideas
- 1.9K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 306 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3K Transform
- 112 SQL DataFlows
- 649 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 787 Beast Mode
- 78 App Studio
- 43 Variables
- 742 Automate
- 187 Apps
- 474 APIs & Domo Developer
- 67 Workflows
- 14 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 406 Distribute
- 117 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 139 Manage
- 136 Governance & Security
- 8 Domo Community Gallery
- 44 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 113 Community Announcements
- 4.8K Archive