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.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
- 754 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 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