Should I really be using UPSERT KEY just to APPEND data?
I have a huge dataset I've uploaded through Workbench. I now want to run a daily APPEND of new data only. I don't see a way to define an "APPEND" key, just an "UPSERT" key. My data won't really change, so I really only need inserts of any records where the defined ID is not already in Domo.
My append query looks for a change date (in my local source table) in the past 3 days. This ensures that if the Workbench job gets missed, it can pick things up on the next run. The job seems to run okay. It inserts new records from the past day, and updates 2 and 3 days ago (which really haven't changed, so they get updated to the same values they were).
Am I missing something? Is there really not a way to only add new data based on a defined ID column? (This would also let users see a true count of how many records were added each run. Now they are seeing the count of updated and inserted records)
Answers
-
Hi @JunkDoom
Your configuration would work to assure you don’t have duplicate records. If you’re wanting to make sure you don’t pull in any record that already exist I recommend looking into the lastvalue replacement variable in workbench query. Workbench will track the last value it sees each run and you can add a condition to your query to only pull data after that value. Just make sure you’re sorting by the last value field in ascending order. You can find more information on it here at the bottom of the article. https://domohelp.domo.com/hc/en-us/articles/4407020836887-Connecting-to-ODBC-Data-in-Workbench-5-1
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0
Categories
- 10.5K All Categories
- 7 Connect
- 917 Connectors
- 250 Workbench
- 464 Transform
- 1.7K Magic ETL
- 69 SQL DataFlows
- 477 Datasets
- 193 Visualize
- 252 Beast Mode
- 2.1K Charting
- 11 Variables
- 17 Automate
- 354 APIs & Domo Developer
- 89 Apps
- 3 Workflows
- 20 Predict
- 5 Jupyter Workspaces
- 15 R & Python Tiles
- 246 Distribute
- 62 Domo Everywhere
- 243 Scheduled Reports
- 21 Manage
- 42 Governance & Security
- 173 Product Ideas
- 1.2K Ideas Exchange
- 12 Community Forums
- 27 Getting Started
- 14 Community Member Introductions
- 55 Community News
- 4.5K Archive