I have a field like below in my input file consists of multiple fp line items and some other time CHG_CLASS will contain only one fp line items.
After I load the data base I would want to check this and depending upon this single fp line items I will execute one logic and if input file has multiple fp line items I will execute one other update logic using tMySQLRow.
Thanks in advance!
Basically I want to look through and check in my input file column CHG_CLASS do I have one single fp line items or more than one fp line items or not.
You can achieve this (if I understand you correctly), by adding a tMap and adding a count column. In the count column use this code....
routines.Numeric.sequence(row1.CHG_CLASS, 1, 1)
What this will do is start a sequence for every CHG_CLASS value that goes through the tMap. So if you data comes through in this order, the "count" column will hold what is shown below....
CHG_CLASS | Count
I've assumed some values as you can see.
The last fp value that is returned will have the max count. This doesn't completely solve your issue because you need to get the value, but I think you can probably find a way of doing this and I do not know the rest of your requirement.
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Part 2 of a series on Context Variables
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema