S3 upload option to "delete all" records in an MDA table before inserting new data records

  • 5
  • Idea
  • Updated 3 weeks ago
We've got an issue that probably most customers have or will run into at some point.  

When we get S3 uploads and it's updated or new data records, S3 insert/upsert works just fine.

But if there is an absence of data that was previously uploaded to S3, there's no way to clear those records.

Would be incredibly helpful to have a "delete all" option to delete all the records in an MDA table before S3 upload job processes so that we can insert the entire fresh export of data.

Has anyone else found a way to get around this issue?
Photo of Jeff Kirkpatrick

Jeff Kirkpatrick, Champion

  • 25,380 Points 20k badge 2x thumb

Posted 2 months ago

  • 5
Photo of Sagan Sherlin

Sagan Sherlin, Champion

  • 4,334 Points 4k badge 2x thumb
+1 This would be awesome!  Right now it's a two step process...and if your forget to delete all the data at first.  Well. More work!  
Photo of Mark Gecsey

Mark Gecsey

  • 602 Points 500 badge 2x thumb
+1 for us as well. 
Photo of Dan Ahrens

Dan Ahrens, Official Rep

  • 24,802 Points 20k badge 2x thumb
Hi folks, 
I wanted to share here an idea that Jeff and I had a chance to discuss via the phone. Since invariably once you drop a table, a few weeks later someone will want historical data, one way to 'get the best of both worlds' would be this approach. 

* You get a daily (or weekly or other regular cadence. For this example we'll use daily.) update file that is the entire data set and is not just incremental updates.
* The data file you are working with does not identify which records are to be deleted - they are just not present on the first cycle where that record is no longer valid

* Add two columns to your MDA file: "Date last updated" (date type field) and "Current" (boolean)
* Create a rule that runs daily before your daily import that sets the value of "Current" for every record in that MDA object to null
* When you import your daily file, upsert your new data to the MDA object and also write the rule date to the "Date last updated" field and set the "Current" field to not null.

This will accomplish two things:
* You'll immediately be able to filter any current records by using that boolean "Current" field
* You'll have a historical record of the last time any individual records were updated
Photo of Samantha Braastad

Samantha Braastad, Champion

  • 7,434 Points 5k badge 2x thumb
As an alternative, you can create a rule that sets the "Current" boolean to null if the "Date Last Updated" field is more then X amount of days in the past. This reduces the number of records that need to be updated each day :)
Photo of Jeff Kirkpatrick

Jeff Kirkpatrick, Champion

  • 25,378 Points 20k badge 2x thumb
Hey Samantha I just noticed this.  nice suggestion!  I'll try to remember for next time.