Calc Functions

The Integrator Calc object supports a wide variety of functions to perform calculations on your data. Data is passed as arguments to these functions. Arguments may be columns, variables (parameters), or constants. Functions can be nested and are evaluated inside to out. These functions are also available in the Visual Integrator and the Builder.

The general form of a function call is:

function(arg, arg, ...)

The defined functions are grouped below into the following categories:

NOTE: For simplicity’s sake, these functions are presented as they are intended to be processed, which is not necessarily how they would present in an Object Language file. As an illustration, consider the following example.

If an example is given of how to calculate an approximate age, using two specific dates, the calculation is presented in a straight forward manner, as

(datevalue("2012/10/21") - datevalue("1954/12/04")) / 365

When keyed into an Object Language Integrator script file with a text editor, this calc string is displayed as:

{
name = "approx_age"
value = "(datevalue(\"2012/10/21\") - datevalue(\"1954/12/04\")) / 365"
}

Notice that the calc definition (value) is itself a string. Also, notice the back slashes that allow the embedded double quotes to be recognized. In general, a back slash is used to escape the string, allowing for recognition of special characters.

In the following topics, most examples are shown with literals such as: age("1945/01/08", "2013/01/01") which returns 67. Most likely, the argument to the age function will not be a literal, but a column name containing similarly formatted data without quotes.

For an alphabetized list of functions, see Alphabetized Functions for Integrator.