2D Table Node
  • 23 Aug 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

2D Table Node

  • Dark
    Light
  • PDF

Article summary

We have included an Interactive Training to provide a more engaging and visual learning experience. End users are required to complete their training through the CSG University.


The 2D Table Node takes exactly two input values, referred to as the X-value and the Y-value, and produces a single output. The output can be any valid JavaScript value. The 2D Table Node is very useful for applying simple segmentation to data. 

The input values for the 2D Table Node are set when the node is used within a graph. Within the node itself, there are simple controls for adding rows and columns to the decision table. A JavaScript expression heads each row and column; the table cell for which the row and column expressions are both true will give the return value. The X-Value expressions are evaluated left-to-right, and the Y-Value expressions are evaluated top-to-bottom. 

The Add Column and Add Row buttons are used to add columns and rows to the table, respectively. Each column or row is headed by a box that expects an expression to be entered in the 'Edit Operator' panel on the right-hand side of the window. All JavaScript expressions are passed the Xponent internal variable 'VAL', which can be used in any valid JavaScript expression.

For example:

The screenshot below shows a 2D Table that expects to receive an Age and a Gender value as the X-value and Y-value inputs, respectively, and will return a segment identifier. The segment identifier (an integer literal) ranges between 1 and 4.

The Operator for the middle column of the X-Value is shown in detail, showing the use of the primary expression type:

The Operator can also be given a display description to make the table more readable. Edit Operator panel would look like this:

Applied to each of the rules, this can be used to make the table more readable:


2D Table Return Values

The 2D Table will return the value at the X-Value and Y-Value row and column intersection, or it will return an 'error' in the Testing Console. The 2D Table can return any valid JavaScript literal value, a schema location, or a public variable. 

For example:

To return a more complex segmentation object from the table above, a literal such as this could be used for the cell return value:

This allows complex two-dimensional segmentations to be applied.


Validation Warnings

: All the invalid notifications will be displayed after expanding the Invalid Drop-down.

WarningNote
Each 2D table cell must have a valid (non-empty) data referenceOne or more table cells do not have a data reference (literal, schema, or public variable) set.
Each 2D table row must have a conditionNo expression has been given for the column or row


Errors

Unable to find value for (x or y) parameter - one of the X or Y values has not been provided in the schema




Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence