Setting expressions for multiple output columns simultaneously
About this task
tMap allows you to define the transformation
behavior for multiple output columns at the same time.
Using a simple transformation Job, the following example shows how to define
expressions on multiple columns in a batch manner in tMap.
Here is the content of the input CSV file used in this example:
id;firstname;lastname;city;state
1; Andrew;Adams;Madison; Rhode Island
2;Andrew; Garfield; Saint Paul;Colorado
3; Woodrow; Eisenhower ; Juneau; New Hampshire
4;Woodrow; Jackson;Denver;Maine
5; Lyndon;Buchanan; Pierre; Kentucky
6; Bill;Tyler; Helena; New York
7;George;Adams;Oklahoma City ;Alaska
8;Ulysses; Garfield;Santa Fe;Massachusetts
9; Thomas;Coolidge ;Charleston; Mississippi
10;John;Polk; Carson City; Louisiana
In this example, all the output columns of type String will be trimmed to
remove preceding and training whitespace and the last names and state names will
be transformed to upper case.
Procedure
In the Map Editor, complete the input-output mappings.
Select the columns of type String in the output table, namely
firstname, lastname,
city, and state in this
example, and right-click the selection so that the Apply Routine button shows up.
Click the Apply Routine button to open the Expression Builder dialog box.
Select StringHandling in the Categories area, and then double-click the
TRIM function in the Functions area to get
StringHandling.TRIM(${0}) in the Expression field.
Click OK to close the Expression Builder dialog box.
Select the lastname and state columns in the
output table of the Map Editor, right-click the selection, and then
click the Apply Routine button to open
the Expression Builder dialog
box.
Select StringHandling in the Categories area, and then double-click the
UPPERCASE function in the Functions area to get StringHandling(${0})
in the Expression field.
Click OK to close the Expression Builder dialog box.
Results
Now the expressions on those output columns look like below:
The functions will be carried out along the flow processing. The output of
this example is as shown below.
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!