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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How to test if tMap output has rows?

Hello,
I need a hand on this problem I got:
I have a tMap component, with two outputs:
1. the regular output table, returning a single record if the expression filter is met, and
2. the output reject table, returning a single record if the above expression filter is not met.
My goal is that, if the regular output HAS a row, then continue processing; that means that the output reject has NO records.
On the other hand, if the output reject has a record, which means the regular output has no records, I want to kill my job.
I do not manage to do this, because in either cases both actions are performed.
If I could test the number of rows of the tMap outputs, I could implement a "Run If" condition, but I do not know how to build the test.
Can anybody guide me how to do this?
I attach screenshots of the job, I am grateful for any suggestion.
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello
On the other hand, if the output reject has a record, which means the regular output has no records, I want to kill my job.

Yes, you get the correct approach to reach your goal with runIf link and global vars. But why you link tJavaRow to tDie in your last image? I think you only need link the reject output to tDie and set the condition as: tLogRow_NB>0
Best regards
shong

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi again,
I finally managed to get the needed behavior from my job, I attach the screenshot, but I wonder:
is there any way to optimise it?

I suspect the answer is YES, and I am looking forward for your advice.
Thank you for helping a beginner to improve his style.
Furnica
Anonymous
Not applicable
Author

Hello
On the other hand, if the output reject has a record, which means the regular output has no records, I want to kill my job.

Yes, you get the correct approach to reach your goal with runIf link and global vars. But why you link tJavaRow to tDie in your last image? I think you only need link the reject output to tDie and set the condition as: tLogRow_NB>0
Best regards
shong
Anonymous
Not applicable
Author

Thank you Shong, you are right.
Best regards,
Furnica
Anonymous
Not applicable
Author

Hello,

 

Can you please attach the screenshot of your solution. I am unable to see any screenshot in the original thread. 

 

Thanks much in advance.