Home > Expression Operators > Miscellaneous Operators > Assignment

Assignment

:= (assignment)

Assigns the result of an expression to a temporary variable.

Syntax:

TempVariable := Expression, followed by an ampersand (&), which is the statement separator.

Examples:

T := A+B+C & assigns the sum of A, B, and C to temporary variable T.

R := A/B & assigns the ratio of A and B to temporary variable R.

D_DT := DOB #DATEPLUS 65y & assigns the date that age 65 is attained (determined by adding 65 years to the database field DOB) to temporary variable D_DT. Use of the suffix _DT instructs the Calculation Results to display the result in readable date format, instead of displaying the date's numeric value (the number of days elapsed since 1/1/1900).

Related Operators:

& (statement separator)


Assignment using array fields

Data Default expression
When you use an array field to create a temporary variable in a Data Default expression (e.g., A:= SALARY &), the temporary variable is only assigned the most recent value in the array (i.e., A is a scalar or single value; it's not an array). The rest of the values (and their start/stop or effective dates) are ignored. (You can change this behavior using an array operator).


Salary, Hours, and Multiplier transformation expressions
When Salaries and Service are calculated, ProAdmin tries to assemble all the dates it thinks you will need (including any dates associated with any array fields used in the expression). These dates are represented by the operator #DATE. So, when a temporary variable is assigned an array field, the values in the array field are associated with specific dates in #DATE, and if you are doing an Estimate Calculation, the values will be projected. The reported values in the last measurement period are used to derive a full measurement period value, and then that value is used as the projected value and allocated to each future measurement period. (In Hours and Multiplier transformation expressions, they are allocated using calendar days; for Salaries, they are allocated using the Salary Definition's allocation assumptions.)