Hi there!
Im trying to recreate a calculation from Redshift to Magic ETL. Im running into some trouble with a specific formula.
In Redshift: DATEDIFF('week',"start_date__c","end_date__c")
In Magic: v1 - DATEDIFF(`end_date__c`,`start_date__c`)/7
In Magic: v2 - WEEKOFYEAR(`end_date__c`) - WEEKOFYEAR(`start_date__c`)
Showing a picture of my results and the comparison that is happening with some sample data. It looks like the Redshift function is behaving similar to the weekofyear formula but is able to calculate across many years, which isnt compatible with my v2 formula.
We can see that the "weekofyear" formula on the right hand side is the most similar, but it doesnt match when calculating across multiple years.
Hoping someone has solved for this before!
Thank you in advance!