One Star

[resolved] Get the lookup inner join rejected row count

Hi,
Is there a direct way to get the lookup inner join reject row count in Talend Open Studio for Data Integration? 
Thanks and Regards,
Asanka.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Manager

Re: [resolved] Get the lookup inner join rejected row count

There is no global variable for sheet. You can define a counter on tJavaFlex to populate the total number of each rejected rows. For example:
...tMap..reject..tJavaFlex--tFileOutputExcel
in the beginning part of tJavaFlex, define a counter.
int counter=0;

in the main part:
counter++

in the end part, store the counter to a global variable or context variable for used later.
context.nb_reject1=counter;

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
5 REPLIES
Community Manager

Re: [resolved] Get the lookup inner join rejected row count

If you output the reject rows to a file or database, there is a global variable that counts the total number of rows are written on output component, for example:
...tMap..reject--tFileOutputDelimited
You can get the number of reject rows by using this global variable:
((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE"))

Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Get the lookup inner join rejected row count

Hi Shong,
Thanks for your reply. 
In my case I'm writing the inner join rejected rows to an excel file (tFileOutputExcel). In my Talend Job there are several inner join rejects, but all are written to single excel file, but different sheets. So is there a way to get the number of rows written to a particular sheet?
Thanks and Regards,
Asanka.
Community Manager

Re: [resolved] Get the lookup inner join rejected row count

There is no global variable for sheet. You can define a counter on tJavaFlex to populate the total number of each rejected rows. For example:
...tMap..reject..tJavaFlex--tFileOutputExcel
in the beginning part of tJavaFlex, define a counter.
int counter=0;

in the main part:
counter++

in the end part, store the counter to a global variable or context variable for used later.
context.nb_reject1=counter;

Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] Get the lookup inner join rejected row count

Hi Shong,
Thank you very much for your reply. Your suggestion will work in my scenario.
Thanks and Regards,
Asanka. 
Community Manager

Re: [resolved] Get the lookup inner join rejected row count

Great! Thanks for your feedback.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business