Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am working on a simple job and I am new to talend. I want to create an excel file from tMAP with rejected records only if tMAP has any rejected records.
I tried following
1. tMAP --main--->tJavaRow-----if trigger (reject_row > 0)------>how to put records from tMAP to excel???
Please find my screenshot attached here.
Any help would be great. Thanks in Advance.
If you want to push rejected record from the join you have into tMap, just tick the option "Catch inner join rejects" for the coresponding outpout (in the tMap editor), then connect this flow to your tFileExcelOutput.
Base on your job design you just have to move the link from tJavaRow_1 to tFileExcelOutput_1.
Or maybe I didn't understand your question???
you can capture the rejects in tmap with these settings
to put it into excel you can output it as a csv file using tfileoutputdelimited and setting the field separator as, ","
Hello TRF,
Thanks a lot for your reply. My issue is that, i want to output rejected excel file only if rejected records are present. That means i want to add run if connection to excel file output when (reject_rows>0).
I am not getting how to check if condition at the same time forward my rejected rows to excelOutput if condition is true. Hope you get me this time.
Hello TRF,
Thanks a lot for your reply. My issue is that, i want to output rejected excel file only if rejected records are present. That means i want to add run if connection to excel file output when (reject_rows>0).
I am not getting how to check if condition at the same time forward my rejected rows to excelOutput if condition is true. Hope you get me this time.
@Prerak, I suggest you to create a sequence in tMap for rejected records and then populate rejectes to tFilterRows and check the sequence number greater than 0 then populate to tFilterColumns to remove sequnce coulmn and write tFileOutputExcel ,and in the Advanced settings enable check box Don't generate empty files. and i have shown the design below.
Hello Manohar,
I like what you have done here, but i am not sure how to achieve "populate rejectes to tFilterRows and check the sequence number greater than 0 then populate to tFilterColumns".
How can i check sequence number greater than 0 in tFIlterRows, also i can not see any if condition in your code. Can please send me component view of your filterRow and filterColumn if possible.
Hello Guys,
I have achieved the said scenario by using following approach
tMap --> output
tMap-->Rejected records--->tHashoutput--->tJavaRow---> Run if (number of records >0)
tHashInput----->ExcelFile
In above scenario, the flow will only reach to output an excel file if there are any rejected records.
@Prerak,Did this help you? If so, thank's to mark your case as solved.