Selecting only newer records from a remote datasource to append to a Domo datasource
Hi here…
When setting up a query to grab data from a remote datasource and append to data in DOMO. Is there a way to grab newer records based on the data that was previously imported.
Page: DATA / <DATASET NAME> / SETTINGS / QUERY
I'd like to run something like:
SELECT *
FROM myRemoteDataSchema.myDataSet
← remote dataset
WHERE dateField > (Select max(dateField) from domo.myDataSet
) ← current Domo dataset
Best Answers
-
@JohnnyN What kind of connector are you using to pull this data? If possible, I'd suggest setting the update method of your dataset to Append, then aligning your query and update schedule so that it always pulls data since the last time the dataset ran.
For example, if you have your connector set to run once a day then you could write your query to only pull data from the previous day.
SELECT *
FROMmyRemoteDataSchema.myDataSet
WHERE dateField = CURRENT_DATE() - 11 -
@JohnnyN - Depending on how you are bringing the data into Domo, you could also change your dataset to be an upsert. If you search the knowledge base for upsert you should be able to see which connectors have this option.
1
Answers
-
@JohnnyN What kind of connector are you using to pull this data? If possible, I'd suggest setting the update method of your dataset to Append, then aligning your query and update schedule so that it always pulls data since the last time the dataset ran.
For example, if you have your connector set to run once a day then you could write your query to only pull data from the previous day.
SELECT *
FROMmyRemoteDataSchema.myDataSet
WHERE dateField = CURRENT_DATE() - 11 -
@JohnnyN - Depending on how you are bringing the data into Domo, you could also change your dataset to be an upsert. If you search the knowledge base for upsert you should be able to see which connectors have this option.
1 -
Hi @MichelleH Yup I am
appending
I have had this method running already. But we had a problem down stream where yesterdays data failed to populated in our datawarehouse. Meaning when the import runs tomorrow I would need to fetchWHERE dateField = CURRENT_DATE() - 2
If I could understand what date was last fetched… maybemax(_BATCH_LAST_RUN_)
I could do the math to get the section of records to Append to DOMO.
Hope that makes sense.0 -
@JohnnyN In that case I would follow @ST_-Superman-_'s suggestion in trying an upsert dataset so you can bring in a rolling X number of days without duplicating.
0 -
@MichelleH OK I didnt hear "rolling X number of days " previously. Yes that sounds like a plan.
0 -
@MichelleH Yup… I'm rolling 4 days worth of data and merging into DOMO. This should cover me for outage over the W/E maybe. As the data is an audit. Most of the historical data selected should be ignored and only new records inserted from the last inserted record.
Seems to be working well. Thanks1
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