Connect multiple tFilter in 1 tMap after a tReplicate + tDBInput

Six Stars

Connect multiple tFilter in 1 tMap after a tReplicate + tDBInput

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.


Accepted Solutions
Six Stars

Re: Connect multiple tFilter in 1 tMap after a tReplicate + tDBInput

Okay, it's impossible to connect differents tFilter from a tReplicate

 

Spoiler
I was thinking that I can merge my 3 filters in a single one, then connect the output of this tFilter in the tMap, filter another time the data and finally dispatch my datas, but that dupliquate my rows because there's no joint/link between the 2 input.


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.


All Replies
Six Stars

Re: Connect multiple tFilter in 1 tMap after a tReplicate + tDBInput

Okay, it's impossible to connect differents tFilter from a tReplicate

 

Spoiler
I was thinking that I can merge my 3 filters in a single one, then connect the output of this tFilter in the tMap, filter another time the data and finally dispatch my datas, but that dupliquate my rows because there's no joint/link between the 2 input.


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.