You are not logged in.
Announcement
Unanswered posts
|
Hi
You can use this expression.
row2.value==null?row1.value:(row1.value+row2.value)
Regards,
Pedro
Thanks, I found the problem from ur example. Normally we can't add expression like "row1.value+row2.value" as the final result, and assign to the output column of tMap. There is a case that tMap can't find a corresponding record from row2 and thus row2.value would be a null pointer.
Hi
Welcome to Talend Community!
According to what you said, I think the job should be like this.
InputComponent(File1)--main-->tMap--out1-->OutputComponent
|
look up
|
InputComponent(File2)
For more info, you can follow this tutorial.
Regards,
Pedro
Hi, all:
I have two files with the same schema, 2 columns, one is the key and another is a double format column. My target is as follow:
1. Loop all records in file 1,
2. for each record, find a corresponding record in file 2, with the same key.
3. if found, then we now have two records.
4. add the double value in file 2 to the double value in file 1
5. write the double value back to file 1.
6. Process the next record.
I tried tMap and tAggregateRow but failed, could anyone help on this? Which component is the correct choice? thanks!