Append only missing rows
I have 2 datasets. I want to append the data togeather and keep all the lines from dataset A but only the lines from dataset B that are not represented in dataset A. I want to do this on a unique identifier. Any hints on how this would best be occoplished. See attached for an example.
Comments
-
In the official Domo literature and training they'd recommend you use a 'Remove duplicates' tile and build a recursive dataflow.
Problem with 'remove duplicates' is there's implicit randomness to how 'duplicates' are defined because you cannot explicitly define that you want to keep data from the left.
You have a few options.
You can APPEND, and then use a Window & Rank tile to assign a row_number. As part of that process you can apply an ORDER BY clause (date is a popular option) and then PARTITION BY the row_id column. If you then filter where row_number = 1, you will deduplicate rows.
Alternatively, if there is no reasonable column to ORDER BY, you can OUTER JOIN the data together.
FILTER where your LEFT row_id is not null, then SELECT the appropriate columns from the left side. and if your LEFT row_id is null then SELECT the appropriate columns from the right side.
You can do this in Magic or MySQL ... you just have to figure out how to do a row_number with a partition clause in MySQL.
Hope that helps!
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"2
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive