Derivative

The Derivative processor is used to derive one or more columns through computation on existing fields present on the datasource.

Add Derivative

To add a Derivative processor, select the button on the menu bar and click on the location in the designer diagram. Use the Flow connector to connect the Derivative processor and another processors together.

The Derivative processor is present but the fields to derive are not defined yet.

Edit Derivative

After the Derivative processor is added, you may need to edit the properties of the Derivative processor.

There are two ways to access the properties of the Derivative processor.

  • Double-click on the Derivative processor
  • Right-click on the Derivative processor and select the “Properties” option from the pop-up menu

Either one method will launch the Derivative Wizard.

There are three tabs in this wizard page, namely “Base”, “Derived” and “JavaScript”.

Base

The “Base” tab displays all fields present on the source from the “Base” input. You can discard any fields by selecting the checkbox under the “Discard” column.

Highlight (or select) a field (or row) and right-click on it, displays a pop-up menu.

The functions are listed below.

Function Description
Discard All Selects all fields to discard in “Discard” column.
Discard None Un-selects all fields from “Discard” column.
Select All Selects or highlights all fields.
Clear Selection Un-Selects all fields.
Add Derivatives From Selection Adds selected fields to “Derived” tab as derived fields.

When “Add Derivatives From Selection” option is selected, the selected fields are added to the “Derived” tab, along with their data type but the “Value” field is empty.

Derived

The “Derived” tab allows you to add derived data based on the fields in the “Base” tab.

On the left of the page, there are a column of buttons, namely “Add”, “Edit”, “Delete”, “Move Up” and “Move Down”. These buttons allows you to add/edit/delete and order the derived fields.

To add a derived field, click on the “Add” button on the left. A “Add Column” dialog box will appear.

Field Description
Name Defines the name of the derived field.
Data Type Selects the data type of the derived field from the drop-down list.
Default value is “Unknown”.
Value Defines the formula to derive the values for the derived field.
By default, it is empty.
Fields Lists the fields of the source.
Double-click the desired field will add the field onto the “Value” field.

Key in the desired name for the new derived field in the “Name” field and select the appropriate field type in the “Data Type” field. From the “Fields” field, double-click to select the desired field to derive from. The selected field will appear in the “Value” field. Key in the appropriate formula to derive the values for the derived field. Click on the “Finish” button to save the new derived field and close the dialog box.

For example, the datasource provides the salary of each employee. But the yearly salary is required in your report. You can select “salary” from the “Fields” field and formulate the yearly salary by adding *12 to salary in the “Value” field. Thus, deriving the yearly salary for each employee in the datasource.

JavaScript

The “JavaScript” tab allows you to add JavaScript code for more complex functionality.

Note that any functions defined within this tab are only used within the scope of the Derivative processor, they cannot be accessed elsewhere. If the functions are to be available throughout all uses of JavaScript, define such functions in the “Composite Diagram Script” tab instead.

Once all desired derived fields are added, click on the “Finish” button to save the changes. To abort, click on the “Cancel” button.

Delete Derivative

To remove the Derivative processor, simply select the Derivative processor and click on the “delete” key on your keyboard. Alternatively, right-click on the Derivative processor to display the pop-up menu and select “Delete Graphic” option.

Pop-up Menu

To access the pop-up menu of the Derivative processor, right-click on the processor.

There are three functions in the pop-up menu.

Function Description
Properties Launches the Derivative Wizard that allows you to edit the properties of the Derivative processor.
View Output Switches to the “Data” tab, which displays the records of the datasource after the operation.
Delete Graphic Deletes the Derivative processor.