A function transformation allows you to apply functions of string, numeric, conversion, and datetime to define an attribute of a logical entity, or one of the parameters of a parent function transformation.
Example 1 - Applying a String Function Transformation
For example, if you wish to trim spaces from the right of each value of the columnItemName
of the physical model table demo_Customers1
and fill in the trimmed
value into the linked Name
column of the logical table
Product
: - Select the
Product
table on the canvas. - In the Transformations panel, click adjacent to the
Name
column, and in the Transformation of column 'NAME' pop-up window, select the Function option. - In the Category drop-down list, select String.
- In the Name drop-down list, select the rtrim(string string) function.
- The String function gets added to the pop-up below the entry fields. Click this function, and define the parameter on which this function needs to be applied by using the Column option such that the resulting data type of the parameter is a string.
- Click OK.
The applied function transformation is depicted on the canvas as below:
Example 2: Applying Numeric function transformation.
- Select the productid column on Product table on the Create Mapping page.
- In the Transformations panel, click adjacent to the
productid
column, and in the Transformation of column productid (integer) pop-up window, select the Function option. - In the Category drop-down list, select Numeric.
- In the Name drop-down list, select abs(integer number). Option to specify the required number is displayed below the Name field.
- Click the number arrow, and use the column option to select CustID (Integer) column of customer_car table in the FramworkDB2 physical model.
- Click OK.
This mapping is displayed on the canvas.