Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm trying to filter data and insert it with tMap.
I use a tDBInput >> tReplicate >> 3 tFilter filtering specific data (If column A = "xxx" then I extract the data in column B, and "xxx" change in each tFilter)
Then I want to connect each output of my tFilter to a single tMap. How can I do this ?
Before, I was loading the database each time there was a tFilter : so 3 tDBInput and 3 tFilter
The objective is to load only one time the database.
Thanks.
Okay, it's impossible to connect differents tFilter from a tReplicate
So the solution with the help of a friend :
Use a tJava after the tFilter to save each value in 3 contexts and then use the appropriate context in the appropriate column in the tMap.
Here is the java code:
switch (input_row.SORT_CODE){ case "Statement ID:" : { context.STATEMENT = input_row.COMPANY_CODE; break; } case "Period:" : { context.PERIODE = input_row.COMPANY_CODE; break; } case "Currency :" : { context.CURRENCY = input_row.COMPANY_CODE; break; } }
- switch is here to indicate which column I will test
- case to indicate when my column match with "Statement ID:" then i save the data which is in input_row.COMPANY_CODE in my context.STATEMENT (you have to create the context for it to work)
- break is here to stop when the value is found.
Okay, it's impossible to connect differents tFilter from a tReplicate
So the solution with the help of a friend :
Use a tJava after the tFilter to save each value in 3 contexts and then use the appropriate context in the appropriate column in the tMap.
Here is the java code:
switch (input_row.SORT_CODE){ case "Statement ID:" : { context.STATEMENT = input_row.COMPANY_CODE; break; } case "Period:" : { context.PERIODE = input_row.COMPANY_CODE; break; } case "Currency :" : { context.CURRENCY = input_row.COMPANY_CODE; break; } }
- switch is here to indicate which column I will test
- case to indicate when my column match with "Statement ID:" then i save the data which is in input_row.COMPANY_CODE in my context.STATEMENT (you have to create the context for it to work)
- break is here to stop when the value is found.