Skip to main content

Generate Columns

Synopsis

This operator constructs new user defined columns using mathematical expressions.

Description

The Generate Columns operator constructs new attributes from the attributes of the input ExampleSet and arbitrary constants using mathematical expressions. The Column names of the input Table can be used as variables in the mathematical expressions for new Columns. During the application of this operator these expressions are evaluated on each row. These variables are then filled with the row's Column values. If a variable is undefined in an expression, the entire expression becomes undefined and '?' is stored at its location.

Please note that there are some restrictions for the Column names in order to let this operator work properly:

  • Column names containing dashes '-' or other special characters, or having the same name as a constant (e.g. 'e' or 'pi') must be placed in square brackets e.g. '[weird-name]' or '[pi]'.
  • Column names containing square brackets or backslashes must be placed in square brackets and the square brackets and backslashes inside the name must be escaped, e.g. '[a\tt[1]]' for a Column 'a\tt[1]'.

If you want to apply this operator, but the columns of your Table do not fulfill above-mentioned conditions, you can rename Columns with the Rename operator before application of the Generate Columns operator. When replacing several Columns following a certain schema, the Rename by Replacing operator might prove useful.

A large number of operations and functions are supported, which allows you to write rich expressions. For a list of operations and functions and their descriptions open the "gui.dialog.parameter.expression.title" dialog. Complicated expressions can be created by using multiple operations and functions. Parenthesis can be used to nest operations.

This operator also supports various constants (for example 'INFINITY', 'PI' and 'e'). Again you can find a complete list in the "gui.dialog.parameter.expression.title" dialog. You can also use strings in operations but the string values should be enclosed in double quotes (").

Input

table input

This input port expects a Table.

Output

table output

The resulting Table with new Columns is delivered to this port.

original

The Table that was given as input is passed without changing to the output through this port. This is usually used to reuse the same Table in further operators or to view the Table in the results workspace.

Parameters

function descriptions

The list of functions for generating new Columns is provided here.

keep all columns

If set to true, the original regular Columns are kept, otherwise they are removed from the table.

default time zone

Default time zone for the expression parser's date-time functions. By default, this parameter is set to the time zone specified in the AI Studio settings.