Transform Node icon
The Clario Transform node is used to create new attributes, recode or rename existing attributes, perform arithmetic functions on existing attributes, and otherwise manipulate attributes in a data stream. For example, you can create a square root transformation of an existing attribute or a ‘Sales per Mailing’ model score by combining a ‘Sales’ model score and a ‘Response’ model score. The node connector of a Transform node can be connected to a variety of nodes, (e.g. Read File, Outliers, Missing, etc.), but requires a valid stream of data.
Configuration
The configuration displays incoming attributes on the left and outgoing attributes on the right. To add attribute(s) to the outgoing stream, drag and drop one or more attributes from the incoming to the outgoing list. To transform an attribute you can either: double-click the attribute in the outgoing list to open the Transform Builder or click [Edit Code] to open the Transform Code Editor.
Attributes are highlighted in the outgoing list to indicate which attribute(s) have been transformed. Attributes with a blue background indicate a transformation. Attributes without a blue highlight are simply passed through to the outgoing stream. Selecting an attribute in the outgoing list draws lines to the incoming attribute(s) used in the underlying transformation.
To create a new attribute, click [New] at the bottom of the Outgoing Attributes list. Enter a name (NOTE: There are no length restrictions for attribute names. However, a new attribute cannot have the same name as an existing attribute), select a type and click [Create] which opens the Transform Builder window. See tips on Valid Characters for Attribute Names.
To remove attribute(s) from the outgoing stream, select one or more attributes (selected attribute(s) will be highlighted in green) and press the delete key. Outgoing attributes can be reordered by selecting them and dragging them to a new position in the list. See tips on Finding and Selecting Attributes to perform actions on multiple attributes at once.
The upper right view contains transform code. This view is read only, to edit it directly open the Transform Code Editor. The code view is highlighted based on the contents of the main work area. It also displays any errors in red, giving you a better indication where the error exists.
The center of the screen contains [Home] and [Back] buttons, to assist in navigation in and out of nested functions. To the right of these buttons are a ‘Name’ field and ‘Type’ dropdown; use these to change the attribute name or type. Valid attribute types are Number, String, or Date. Below the [Home] and [Back] buttons is the main work area, where functions, attributes, and constants will be placed. When finished adding code to the main work area, click [Save] (bottom right) to save and exit to the Transform Configuration tab. Or, click [Cancel] to exit without saving.
The far left box contains three tabs located at the top of the box:
Select a function, attribute, or constant, then drag and drop it into the main work area. See tips on Finding and Selecting Attributes.
Transform Builder
See what Functions, Operators, and Constants can be used in the Transform node.
The code editor is an advanced feature giving you the ability to create Transforms with code instead of the builder. Once you’ve entered your code, click [Check] to verify it is syntactically correct. Any syntax errors that exist are displayed in the Messages window. Your code must be syntactically valid in order to save. In addition to syntax verification, the check operation will validate your Transform code, displaying any validation errors in the Message window. Unlike syntax errors, it is OK to save an invalid Transforms just like you can in the builder. Refer to the complete coding guide for more information.
Transform Code Editor
In the Transform node’s Configuration, click [New], enter an Attribute Name and Type to create a new variable. This will take you to the Transform Builder.
Empty Transform
The following is an example of constructing the product of a few attributes:
Blank work area
One attribute
Two attributes
Attributes can be dropped above or below existing attributes on the work area. Once on the main work area, attributes can also be re-ordered by dragging and dropping them above or below existing attributes. Once multiple attributes are in the main work area, it is possible to change the operators that connect them. The default operator is addition (+).
Dropdown operator
Any errors will be highlighted in red. If you hold the mouse over them, an informative error message will appear. Once errors have been resolved, click [Save].
The following is an example of how to create a conditional:
Blank work area
Condition
Add attribute to If
Constant numbers, strings, dates, and nulls can also be used by clicking on the cons tab on the left of the Transform window. You can then drag and drop a string/number/date/null into the main work area. Once they’ve been dropped, you still need to define a String/Number/Date by typing a value directly into its field. Constant numbers default to 0, strings default to an empty string, and dates default to the current day.
Add number to If
Changes can be more easily made in this closer view. When you’re done, navigate back to the main work area level by clicking [Home] in the middle of the screen. In a nested conditional, you may navigate back out one level by clicking [Back].
Drill into Condition
Any errors in the conditional will be highlighted in red, and if the code is nested you can drill into it then hold the mouse over the code until an informative error message appears.
Conditional complete
Below is a more complicated conditional, with a logical AND in the ‘If’ area, and functions in the ‘Then’ and ‘Else’ areas.
More Complicated Conditional
See the Transform Node Results.
The newly transformed dataset is ready for immediate use in various nodes located throughout Clario. The data can be exported at any point in a workflow by using the Write File node.