Migrating ADF to Salesforce v2 Dataset, how to get MAX() value of Object's LastModifiedDate
Hello,
I'm migrating to the new Salesforce v2 linked service and dataset. We have a dynamic set up to load the delta from Salesforce into our SQL Server DWH every night. We loop over all Objects that we sync, and start off with executing this statement in a Lookup activity, e.g.
SELECT MAX(LastModifiedDate) delta_attribute_max_value FROM Contact
The next steps are to load all data of which the LastModifiedDate is between the previous succesful run's, and this fetched value, and upsert the records. Thankfully our queries for the Copy Data activity were already SOQL. However, the above statement is no longer possible.
How to proceed? According to this article, I can no longer perform an aggregate function, nor do an order by desc and fetch the top row.
I'd rather not create 50 reports in Salesforce that contain the max LastModifiedDate for each object. Is there another way?