LAST_EXECUTION macro

The time that the Modeling Service receives a script is the time used by the LAST_EXECUTION and LAST_IMPORT macros. The command is received from the user interface or from an API.

Typically, LAST_IMPORT is used with load queries and LAST_EXECUTED is used with scripts. However, LAST_EXECUTED can be used with load queries if required.

When you use LAST_EXECUTION, this is the order of events:

  1. The Modeling Service receives the request to run the load query.
    The time at which this happens is the time used by LAST_EXECUTION, which receives the command from the user interface or from an API.
    Note: Network communication can cause a delay between clicking the button to run the macro and the start of the process.
  2. SQL Scripts perform these tasks:
    • Send the request to the staging table
    • Update the last record.
  3. Non-SQL scripts perform these tasks:
    • Run non-SQL functions
    • Report the last function finished, with the result. For example: OLAP mapping finished fully.

If the script finishes successfully, the LAST_EXECUTION time is displayed here:

  • In the Last Executed field of the script
  • In the application logs, the Script Execution Start event logs the start time of the script
    Note: The Script Execution Start event is not enabled by default
  • In the LastSuccessfulExecution column in the Scripts object table