Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create reject record's excel only if tMAP have any

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. 

 

0683p000009LwnM.png

 

 

Any help would be great. Thanks in Advance. 

Labels (3)
10 Replies
TRF
Champion II
Champion II

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???

Anonymous
Not applicable
Author

you can capture the rejects in tmap with these settings 0683p000009LwFp.png

 

to put it into excel you can output it as a csv file using tfileoutputdelimited and setting the field separator as, ","

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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.

manodwhb
Champion II
Champion II

@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.

 

0683p000009LwqH.png

Anonymous
Not applicable
Author

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.

manodwhb
Champion II
Champion II

You need to generate sequence in tmap for rejected section using sequence () function in tMap
Anonymous
Not applicable
Author

Hello Guys,

 

I have achieved the said scenario by using following approach

 

0683p000009Lwci.png

 

 

 

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.

 

manodwhb
Champion II
Champion II

@Prerak,Did this help you? If so, thank's to mark your case as solved.