EVAL function

This function can be used to evaluate the mathematical expression. It supports expressions that are supported in JavaScript. For evaluating expression we are using JavaScript engine.

EVAL functions can be used in all three sections of DATA TRANSFORMATION i.e. HEADER, FOOTER or FIELD.

Function:
 EVAL([EXPRESSION];INPUT[PARAM_LIST_USED_IN_EXPRESSION])

INPUT parameters has two sections separated by semicolon ( ; ) delimiter.

  • EXPRESSION – This will be the expression that we want to evaluate. It is enclosed with square brackets i.e. ( [] )

EVAL([(FLD1+FLD2+10)/2];INPUT[FLD1,FLD2])

  • PARAM_​LIST_​USED_​IN_​EXPRESSION – This will be the list of Field Names (only those defined in Field Transformation) used in expression. It is enclosed with square brackets i.e. []

EVAL([(FLD1+FLD2+10)/2];INPUT[FLD1,FLD2])

If FLD1 = 5 and FLD2=7 then this function will return 11