The Data Calculator component window provides tabular and graphic views of the data stream. You can also use this window to map port attributes and define transformation rules.
The tabular view shows the current record structure, port attributes, and transformation rules. It includes:
Current Input Record pane – identifies each attribute and attribute value in the current record at the IN-port. All IN-port attributes include an “IN.” prefix.
Transformation Rules and Current Output Record pane – includes a column and row for each transformation rule, and columns and rows for each OUT-port attribute. Default transformation rules map each IN-port attribute to a corresponding OUT-port attribute. By default, OUT-port values reflect IN-port values. Changing an attribute value or transformation rule changes OUT-port values.
If the transformation rule is a functional expression, you must enter it on a single line. The returned value is, by default, assigned to the corresponding OUT-port attribute. However, if you enter a multiline functional expression, the text is interpreted as a script, and you must set the OUT-port attribute value.
Input Port Content pane – shows the current set of records available at the IN-port.
Output Port Content pane – shows the current set of records available at the OUT-port.
The graph view shows the current mapping between the IN-port and OUT-port attributes.
Input Port Content pane – shows the current set of records available at the IN-port.
Output Port Content pane – shows the current set of records available at the OUT-port.
After you apply a transformation rule to an IN.attribute, the mapping line between the IN.attribute and the OUT.attribute no longer appears.
Although the Data Calculator component creates column-to-column mapping between the IN-port and OUT-port as a default option, there may be times when you want to map port attributes individually. To create your own mappings, use the graphic view.
On the Data Calculator component window, click the Graph tab.
Map the IN-port and OUT-port in one of these ways:
Select Mapping in the menu bar, and select one of these predefined mapping sequences:
Create mapping by Order – sequentially maps the port attributes of the IN-port and OUT-port.
If the number of attributes is different, some port attributes are not mapped.
Create mapping by Name – maps the port attributes of the IN-port and OUT- port according to their names.
Create mapping by Name Case Sensitive – maps the port attributes of the IN-port and OUT-port according to their case-sensitive names.
Create mapping by prefix – maps the port attributes of the IN-port and OUT-port by name, ignoring the specified prefixes.
Create mapping by Best Match – maps the port attributes of the IN-port and OUT-port that sound alike.
Connect the IN-port and OUT-port attributes individually.
The component is now ready to be used and can forward records from the IN-port to the OUT-port.
The Data Calculator immediately displays the result of transformation rules, allowing you to verify incoming data, test transformation rules, and view the effect of the rules on data output.
By default, OUT-port values reflect IN-port values. Manually changing an IN-port attribute value affects only the data of the IN-Port or OUT-port buffer, allowing you to test transformation rules, and to see the results in the current output record. This is a convenient way to create test cases for transformation rules.
Use the Transformation Rule column to add, modify, or delete transformation rules. You can also edit single-line functions by changing the current attribute input field.
See “Using the JavaScript Editor and Debugger” for information about creating complex procedural transformations.
The graphic view mirrors the actual port structures. You cannot add or delete attributes in the graphic view.
Managing transformation rules
To add a transformation rule, right-click anywhere in the Transformation Rule or Current Output Port column, and select Insert. You can now use the added rules for further assignments or calculations.
To delete a transformation rule, right-click a row in the Transformation Rule column, and select Remove.
To change the order of the transformation rules, right-click the row in the Transformation Rule column, and select Up or Down.
To add missing output attributes, click Mapping, and select Add missing output attributes.
Transformation rules are processed in sequential order. The processing starts with the first transformation rule of the list.
Data Calculator is designed so you can see the changes applied to data as it moves through the transformation rules. You may find this useful, for example, to see how changing a transformation rule affects outgoing data. Depending on the status of the Auto-Synchronization button, a transformation rule is immediately applied to the entire set of IN-port records after the rule is entered.
Toggling auto synchronization – auto synchronization immediately applies all changes to the transformation rules to the current set of records at the IN-port.
If Auto-Synchronization is disabled, you can manually trigger the processing of the IN-port data by selecting the Step option.
Manually apply all transformation rules to all current records at the IN-port.– by clicking the Step icon on the toolbar.
Fetching another set of records – by clicking the Step through the next incoming data buffer icon on the toolbar.
To step through IN-port records –
Click the appropriate record control on the toolbar.
Click Navigate and select the appropriate option.
Select a record from the Input Port Content list.
Search for keywords in the transformation rules – by clicking the Search the Content of Transformation Rules icon on the toolbar
The values shown on the Current Input Record area are updated as you change the current record.
Highlight null and empty values – by clicking the Highlight NULL-Values and Empty Values icon on the toolbar.