-
Book Overview & Buying
-
Table Of Contents
Talend Open Studio Cookbook
By :
The tMap component is the most flexible and most used component in Talend, despite having the limitation on multiple lines for an expression. In the previous recipe, we saw how ternary expressions can be used to extend the capability of the tMap expressions. In this recipe, we will see that the tMap variables can also extend the capability of tMap.
Open the job jo_cook_ch04_0040_tMapVariables.
In the Var section, click + to add a new variable, set the name to paymentTotal and Type to float, as shown in the following screenshot:

Insert the following code into the expression field:
customer.payment1+customer.payment2+customer.payment3+customer.payment4+customer.payment5+customer.payment6
Repeat step 1 for a variable named averageLastSixMonths with Type set to float, and a variable named averageAnnual also with Type set to float.
Select paymentTotalRow by clicking the left mouse button.
Drag the paymentTotalRow variable into the Expression...