Working with the component window

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.


Tabular view

The tabular view provides a structural view of the current record structure, port attributes, and transformation rules. It includes:


Graph view

The graph view shows the current mapping between the IN-port and OUT-port attributes.

The Data Calculator Graphic View shows the current mapping between the IN-Port and OUT-Port attributes.

StepsMapping port attributes

Although Data Calculator 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.

  1. On the Data Calculator component window, click the Graph tab.

  2. Map the IN-port and Out-port structures in one of these ways:

    • Select Mapping in the menu bar, and select one of these predefined mapping sequences:

      • Create mapping by Order – maps the port attributes of the IN- structures and OUT- structures sequentially.

        NoteIf the number of attributes is different on both sides, some of the port attributes are not mapped.

      • Create mapping by Name – maps the port attributes of the IN-structures and OUT- structures according to their names.

      • Create mapping by Name Case Sensitive – maps the port attributes of the IN- structures and OUT- structures according to their case sensitive names.

      • Create mapping by prefix – maps the port attributes of the IN-structures and OUT- structures by name, ignoring the specified prefixes.

      • Create mapping by Best Match – maps the port attributes of the IN- structures and OUT- structures 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.


Displaying transformation results

One of the essential features of Data Calculator is the capability to display the result of transformation rules immediately. This simulation capability allows you to verify incoming data, test transformation rules, and view the effect of the rules on data output.

Current input record attribute values

By default, output port values reflect Input port values. Changing an Input port attribute value lets you test transformation rules, and to see the results in the current output record. Manual modifications made in this area affect only the data of the Input or Output port buffer. This offers a convenient way to create test cases for transformation rules.

Editing transformation rules

In the Transformation Rule column, you can add, modify, or delete transformation rules. You can also edit single-line functions by changing the current attribute input field. Adding the function uUpper to the attribute IN.PR_NAME looks like the following example:

IN.PR_NAME

You can use the Procedure Editor. See “Using the JavaScript Editor and Debugger” for information about creating complex procedural transformations.

You can also add transformation rules. This is extremely helpful if the number of OUT attributes does not match the number of IN attributes, or if you add additional attributes to the project at a later stage of development.

NoteThe graphic view mirrors the actual port structures. You cannot add or delete attributes there.

StepsManaging transformation rules

  1. To add a transformation rule, right-click anywhere on the Transformation Rule or Current Output Port column.

  2. Select Insert.

You can now use the added rules for further assignments or calculations

Sequence of processing transformation rules

Transformation rules are processed in sequential order. The processing starts with the first transformation rule of the list. Consider the following example:

Transformation rules

Line 9 looks up the number of zip codes for the city and stores the result in CitySize. The procedure in Line 10 calculates the CitySize string based on the CitySize number.


Simulating Data Calculator

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 the outgoing data. Depending on 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:

Autosynchronization immediately applies all changes to the transformation rules to the current set of records at the IN-port.

NoteIf 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 manually apply all transformation rules to all current records at the IN-port, click the Step icon on the toolbar.

Fetching another set of records:

To fetch another set of records, click the Step through the next incoming data buffer icon on the toolbar.

Stepping through input port records:

To step through records at the IN-port:

Note The values shown on the Current Input Record area are updated as you change the current record.

Search for keywords in the transformation rules:

Click Search the Content of Transformation Rules icon on the toolbar.

Highlight null and empty values

Click Highlight NULL-Values and Empty Values icon on the toolbar.