Date Offsets
When
Date Offsets are used in Fetch and Load Stages to tell FXLoader which dates to fetch from or load to; and in Average Stages to tell FXLoader which date range to calculate averages for. The Extra dates function is also used in Load Stages so that rates can be loaded into a date range of more than one day.
Examples
-
Using Date Offsets within Fetch Stages
Your run is scheduled for 03:30 UTC and you want to fetch rates which were issued by your Rates Source at 10PM US ET the day before. You achieve this by setting the ‘Date Offset’ to -1 and the ‘Date Offset Units’ to Days.
Your run is scheduled for 22:00 UTC and you want to fetch rates which were issued by your Rates Source at 10:00 UTC earlier that day. You achieve this by setting the ‘Date Offset’ to 0 and the ‘Date Offset Units’ to Days.
-
Using Date Offsets within Load Stages
Your run is scheduled for 22:00 UTC and you want to load rates in to the following day in your ERP Instance. You achieve this by setting the ‘Date Offset’ to 1 and the ‘Date Offset Units’ to Days.
Your run is scheduled for 06:00 UTC and you want to load rates in to the same day, as well as the next 5 days. You achieve this by setting the ‘Date Offset’ to 0, the ‘Date Offset Units’ to Days, the ‘Extra’ to 5 and the ‘Extra Units’ to Days.
You schedule a run for the last day of the month and want to load the rates for that day into every day of the following month. You achieve this by setting the ‘Date Offset’ to 1, the ‘Date Offset Units’ to Start of Month, the ‘Extra’ to 0 and the ‘Extra Units’ to End of Month.
-
Using Date Offsets within Average Stages
You schedule a run for the first day of the month to calculate the average rates from the previous month. You achieve this by setting the ‘End Date Offset’ to -1, the ‘End Date Offset Units’ to Days, the ‘Start Date Offset’ to 0 and the ‘Start Offset From’ to Start of Period of End Date.
The following example is quite complicated but should highlight how FXLoader’s Date Offsets work:
A run is scheduled for the first day of each month to calculate averages: The Average Stage within the run has the following settings: ‘End Date Offset’ = 1; ‘End Date Offset Units’ = Days; ‘Start Offset Date’ = 2; ‘Start Offset From’ = Start of Period Before End Date. The Average Stage obtains its rates from a Daily Run which fetches rates with a Date Offset of -1 and loads them with a Date Offset of 1.
So, on 1-May the Daily Run fetches rates from 30-Apr and loads them into 2-May. On 2-May it fetches rates from 1-May and loads them into 3-May. And so on, until on 31- May it fetches rates from 30-May and loads them into 1-Jun; and on 1-Jun it fetches rates from 31-May and loads them into 2-Jun.
On 1-Jun our Average Stage sets its End Date to 2-Jun (because the End Date Offset is 1 Day). Its Start Date is set to 3-May (i.e. a 2 day offset from the Start of the Period Before the End Date). Thus, the average calculated is for the dates loaded into the range 3-May to 2-Jun. However, these rates were actually fetched from the range 1- May to 31-May, i.e. for the whole of the previous month.