Using the Data Updated As Of field to ensure that the analytics report API runs after ETL completes
In this blog we will describe how to use the “Data Updated As Of” field to ensure that a report will be retrieved by an API after the ETL completes.
As a prerequisite for this blog it is highly recommended to first see:
- How to use an API to retrieve an Alma Analytics report in 5 easy steps
- How to use the “limit” and “ResumptionToken” in the “Retrieve Analytics report” API .
If an institution is using an API to extract Alma Analytics Data and the institution wants to make sure that the API will run only after the ETL (Extract Transform Load from Alma to Analytics) completes then:
The field “Data Updated As Of”, from the “Institution” folder, can be used. See screenshots below.
This field appears in both Alma and in Alma Analytics and indicates the date according to which the data was extracted from Alma.
For example, if the institution runs a script every morning which extracts an analytics report, and the institution wants to run it only after the ETL has completed then
- Add the field “Data Updated As Of” to the report
- Have the script check the date of the “Data Updated As Of”
- In the case below the script could state “If ‘Data Updated As Of’ = Yesterday” then continue, otherwise run again later.
On a technical level this could be written as follows:
CAST(“Institution”.”Data Updated As Of” AS DATE) = CURRENT_DATE-1
In the case below if the ETL had not finished then the ‘Data Updated As Of’ would be two days ago and not “Yesterday”.
Note that in some environments the ETL starts at 01:00 AM and not 08:00 PM the night before, and in that case the script should check:
If ‘Data Updated As Of’ = Today” then continue, otherwise run again later.
|The field in Alma||The field in the Institution Folder||The field in the results tab|