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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

how to use global variable in runif condition

Hello!

I have a challenge 0683p000009MACs.png

I have a task to check the count of Mysqlinput query is 2. If the count is 2 then only trigger the email, otherwise no need to trigger email.

Please find the screenshot of my job flow below:0683p000009M9lr.png

I used to tjavarow to capture the out from tmap and store it in global varibale, see below:

0683p000009M9io.png

 

How to check the global variable value for 2 in runif condition.

 

Please help me anyone as I am new to Talend.

Labels (4)
3 Replies
TRF
Champion II
Champion II

Here is the expression for the "If" trigger:

((Integer)globalMap.get("tDBInput_1_NB_LINE")) == 2

If you want to print the value:

System.out.println("Value is " + ((Integer)globalMap.get("tDBInput_1_NB_LINE")));

 

Anonymous
Not applicable
Author

I used the below line in runif and it worked:

!globalMap.get("globalvar").equals(2)

TRF
Champion II
Champion II

Did you try for an input table with just 2 lines?