Carrot reference
Functions

asOf()

Returns the result of a Carrot expression on a particular date using either only Primary data, or both Primary and Scenario based data.

Syntax

asOf - Returns the result of a Carrot expression on a particular date using data from both Primary, and the Scenario that the function is used in.

asOf( date: Date, expression:{CQL} )

  • date - The selected date.
  • expression - The Carrot (CQL) expression.
  • Return type: The data type result of the Carrot (CQL) expression.

Code sample

Result

asOf('2017-07-01', {performanceRating})

Returns the value of performanceRating as of January 7th, 2022 using data on Primary and from proposed Scenario changes.



asOfPrimary - Returns the result of a Carrot expression on a particular date using data from Primary.

asOfPrimary( date: Date, expression:{CQL} )

  • date - The selected date.
  • expression - The Carrot (CQL) expression.
  • Return type: The data type result of the Carrot (CQL) expression.

Code sample

Result

asOfPrimary('2017-07-01', '2022-08-01", 2.5)

Returns the value of performanceRating as of January 7th, 2022, using only the data on Primary. Does not include data from proposed Scenario changes.



Updated 04 Oct 2023
Did this page help you?