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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Conditional component, simple if true commit else die ...

Hello,

 

I just want to do a simple if statement between 2 integers in order to determine the next action : commit or die. But i don't find out how to manage that simple thing...

 

I use a tDBInput with a select count(*) in order to get my first integer. Then i use a tFixedFlowInput to get the second integer value with this expression ((Integer)globalMap.get("user_customer_NB_LINE_INSERTED")). Now i just need to compare these 2 values, commit if they are equals, die if they are different.

 

0683p000009M0c4.png

Can someone help me achieve this please ?

 

I tried using tMap, tFilterRow, RunIf but didn't find the right way...

 

Thanks,

Guillaume.

Labels (2)
13 Replies
Anonymous
Not applicable
Author

My tJavaRow component already containt java system.out.println, that's why you can see some text printed "Before tDie 5414 5414". I display here my two variables and as you can see they are totally equals.

 

I guess this is and execution order issue because this text, as i writed, should be executed "before tDie" and that's apparently not happening this way. The content of my variables appears after the error message of my tDie component...

 

I also tried to move the code with my system.out.println inside the tJava component that is just before the tDie one, but after that onSubjobOk link. The result is strictly the same !

Anonymous
Not applicable
Author

Hi,

 

     Could you please share below details?

 

a) Screen shot of full job flow

b) Screen shot of the if condition you are using for comparison

c) Screen shots of current System Print commands you have given

 

Warm Regards,

 

Nikhil Thampi

Anonymous
Not applicable
Author

 

Here all the screenshots you asked me 0683p000009MACn.png 

 

0683p000009M0zl.png

0683p000009M0zm.png

 

0683p000009M0jP.png

 

0683p000009M0p3.png

 

0683p000009M0zv.png

 

Result after running below. As you can see, the execution order seems correct after replacing tDie by tJava. I think the execution order was correct though but the tDie component might disturb the display...

0683p000009M0zc.png

 

Anonymous
Not applicable
Author

Hi,

 

I'm back with a "solution" or rather a bypass...

 

After querying my first database with a select count(*) in order to get the number of rows expected in my second db (after insertions). I use a tMap to store the result of the comparison between my two values (see below).

 

0683p000009M0r5.png

 

Then I store this result in a global var (that could have been a context var) and I use it inside my RunIf links to test wether the comparison returned true or false.

 

This is working well but that's just a bypass. I really think there is a talend issue if I try to do this comparison right inside the RunIf links without doing it before in a tMap as I am doing now.

 

0683p000009M113.png

 

0683p000009M118.png

 

0683p000009M0pm.png