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

Related products: None

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?
+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!  
+1 for us as well. 
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. 





Assumptions:


* 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





Approach:


* Add two columns to your MDA file: "Date last updated" (date type field) and "Current" (boolean)


* Create a rule that runs daily [i]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
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 🙂
Hey Samantha I just noticed this.  nice suggestion!  I'll try to remember for next time.