@COMPUTE returns the value of an arithmetic expression to a target column. The value returned from the function is in the form of a string.
@COMPUTE
You can omit @COMPUTE when returning the value of an arithmetic expression to another function.
Syntax
@COMPUTE (value operator value)
value
One or more values on which you are performing calculations.
operator
A valid arithmetic or logical operator.
Examples
This example adds AMT and AMT2 and returns the total to AMOUNT_TOTAL.
AMT
AMT2
AMOUNT_TOTAL
AMOUNT_TOTAL = @COMPUTE (AMT + AMT2)
This example is invalid because the expression is not enclosed in parentheses.
AMOUNT_TOTAL = AMT + AMT2
Scripting on this page enhances content navigation, but does not change the content in any way.