Expression

An Expression is a piece of code when executed returns a value. Expression consist of aFunctions, constants, and variables.

  • An Expression needs to starts with ‘=’.
  • An Expression is basically a single aFunction call whose arguments can be
  • constants or variables or other aFunctions.
  • An Expression can be part of the RBA Assignment, Criteria Min, MAX, Object, or DX selection criterion’s min or max value.
  • An expression can call any number of aFunctions with variable arguments.
  • An aFunction call can have maximum upto 15 number of arguments.
  • An aFunction’s output can be directly another aFunction’s input.
  • Expression can contain %variable.
  • Expression can contain $variable.
  • Inside an expression, an Array of Object is constructed by enclosing individual values within curly braces { }.
  • In the runtime, a complete RBA configuration or an individual expression inside DX gets converted to Java source and gets compiled to Java byte codes (class files) using dynamic compiling techniques.

Sample Expressions

=NOW()
=DATEOFFSET(NOW(),-6)

An aFunction’s output can be directly another aFunction’s input

=DATEOFFSET(NOW(),-6)

Where now() is a function which is an input to DATEOFFSET() function.

Expression can contain %variable

=DATEOFFSET(NOW(),%mm)

Where “mm” is an RBA ‘Object Field Name’ or DX Input Column which gets resolved in the runtime.

Expression can contain $variable

=DATEOFFSET(NOW(),$nn)

Where $nn is an input parameter which gets resolved in the runtime.

Inside an expression, an ‘Array of Object’ is constructed by enclosing individual values ‘within curly braces { }’

={"value1", %mm, $nn}

Accessing ‘Object field value’ inside an expression

An ‘Object field value’ can be accessed via %ObjectName.

O_Aggregation_Key0 =SUM(%I_Material, %I_Plant)
O_QUANTITY =%I_QUANTITY

Declaring Array inside an expression

An Array of Object is constructed by enclosing individual values within curly braces { }.

Note

Operator IN or !IN expects Array Of Object.

={"value1", %mm, $nn}
=("value1", %mm, $nn)
={"US", "IN"}
={10, 20}

Note

As a special case if the expression starts with =( and ends with ) then in the runtime it is automatically converted to ={val1, val2, val3}.

=(val1, val2, val3)

Accessing User Parameters inside an expression

In an expression, a User Parameter value can be accessed via $Parameter.

O_OFFSET =$OFFSET
O_FORMAT =$FORMAT

Special considerations while dealing with variables kind $ or %

Expression supports variable type $ or % with space and special chars in between.

%"variable name"

$"variable name"

It is comparable with Java String literals.

Example 1 If the variable does not contain space or special chars

If the variable does not contain space or special chars, then the old rule is still valid.

%Column2

Which is equivalent to,

%"Column2"

Example 2 (with space)

Assume that the source table contains column name as 2. Column 2.

Thus inside an Expression with UCASE call needs to be written as below,

=UCASE(%"2. Column 2")

Example 3 (with space and backslash)

Assume that the source table contains column name as 2. Column 2.

Thus inside an Expression with UCASE call needs to be written as below,

=UCASE(%"2. Column \\2")

Example 4 (with space and backslash and double quotes in between)

Assume that the source table contains column name as 2. “My” Column 2.

Thus inside an Expression with UCASE call needs to be written as below,

=UCASE(%"2. \"My\" Column \\2")

Current Limitations

  • Inside an Expression an AFunction cannot deal with more than 15 numbers of arguments.
  • Simple arithmetic operations is not allowed, Like =11 + %mm + $nn, Instead the same expression should be rewritten as =SUM(SUM(11,%mm),$nn).