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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

abort job when duplicates are found

Hi, I have a situation when I have to abort the job when the duplicates are found and not load it to output file.  

I have below logic:

 

In case duplicates are found, the job dies. but in case there are no duplicates, the job doesnt load the output file.  I pass a dummy variable on tfixedflowinput(which i think i m doing wrong), as it doesnt update the file with 4 fields from source. how to do it..? Thanks! 

0683p000009M0aD.png

Labels (2)
7 Replies
Anonymous
Not applicable
Author

it is better to make use of the after variables of the tUniqRow which tells the number of uniques and number of duplicates found from input , you can keep the uniques in temporary and update only if the number of duplicates are zero, and yes tFixFlowInput would not work that way 

Anonymous
Not applicable
Author

0683p000009M0XE.jpg

 

something like this would work i guess

Anonymous
Not applicable
Author

@CK395, can u give export of this job?

when i do IF, it doesnt give me option of tdie. is there anything special u did..? Neither do i get option for thashinput & thashoutput

Anonymous
Not applicable
Author

Hi,

 

     Here is an alternate option to resolve your problem. Add a context variable "row_count" in integer format.

0683p000009M0ab.pngJob details with taggregate component details

 

0683p000009M0VI.pngloading count to a context variable

 

 

The tjava component connected to On Subjob Ok is dummy. The if component connected to tDie is :-

 

context.row_count !=0

 

and the if condition connected to the next flow will be having the condition

 

context.row_count ==0

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

@nthampi - Thanks for the logic. what did u put in tfixedflow input..?

Anonymous
Not applicable
Author

Hi,

 

I didn't notice that earlier skeleton diagram was missing the data capture of unique records. 

 

You can store the unique records in a format of your choice (either as file or hash) and read them later for downstream processing.

0683p000009M0b0.jpg

 

 

If the answer has helped to answer your query, please mark the topic as resolved. Kudos are also welcome 🙂

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

my bad i didn't see the choose files button earlier,

Anyways, the job is attached, make sure to change the file paths and configure components according to your schema.

 

 

let me know if it fulfilled your requirement or not.

 

 

regards 

Chandra Kant


DieIFDuplicate.zip