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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
jcpreaux
Contributor II
Contributor II

Compare values returned by subjobs and execute another.

Hi,

 

I've 2 subjobs (Subjob #1 & #2) whom return values (put in the globalmap) and i want to execute another subjob (Subjob #3) if these values are equals.

 

I'v tried with the "if" trigger but the third subjob is always played even if values aren't equals.

 

----

# Subjob #1 : Sales query    
tMysqlInput_1 ----- tMap_1 ------ tFileOutputDelimited_1 (myFile.csv)
                        |
                        |
                        |
                    tAggregateRow_1 ----- tJava_1 (globalMap.put("CA_Ventes",row4.SUM)
                        
# Subjob #2 : Statistics query                    
tMysqlInput_2 ----- tJava_2 (globalMap.put("CA_Stats",row5.SUM_MONTANT_LIVRE_)

# Subjob #3 : (globalMap.get("CA_Stats") == globalMap.get("CA_Ventes"))? put FTP : Die and call

------

 

Any idea ?

 

PS : i use TOS for Data integration v6.5.1.

 

Thanks.

 

JCP

Labels (1)
1 Solution

Accepted Solutions
jcpreaux
Contributor II
Contributor II
Author

Hi,

 

The problem came from the way i compared my values in the if trigger.

 

I replace :

globalMap.get("CA_Stats") == globalMap.get("CA_Ventes")

By :

((BigDecimal)globalMap.get("CA_Stats")).compareTo(((BigDecimal)globalMap.get("CA_Ventes"))) == 0

 

And it works fine.

 

Thanks !

 

JCP

View solution in original post

8 Replies
vboppudi
Partner - Creator III
Partner - Creator III

Hi,

 

What are you trying to do in subjob3?

 

Regards,

 

jcpreaux
Contributor II
Contributor II
Author

Hi,

 

The subjob #3 puts the file generated by subjob#1on an FTP server.

 

JCP.

Anonymous
Not applicable

The looks like it should be OK. Can you post a screenshot please and also show the RunIf condition? It might also be interesting to see how you set the globalMap values.

jcpreaux
Contributor II
Contributor II
Author

The job :

0683p000009LtBx.png

 

 

 

The second id condition : globalMap.get("CA_Stats") != globalMap.get("CA_Ventes") 

 

The subjob #3 isn't yet designed but i tried with Sendmail and Die components.

 

Components tJava_2 and tJava_3 put values in the globalmap :

 

#2 :

globalMap.put("CA_Ventes",row2.SUM);

 

#3 :

globalMap.put("CA_Stats",row3.SUM_MONTANT_LIVRE_);

 

 

 

Thanks,

JCP

vboppudi
Partner - Creator III
Partner - Creator III

can you please check globalMap assignment working properly ?

 

Display global value before using in condition. 

 

I tried the same and it's working.

 

0683p000009Lsp5.png

 

Regards,

 

jcpreaux
Contributor II
Contributor II
Author

I've modified the job because globalmap variables were'nt well assigned.

 

 

0683p000009LtC2.png

 

The component tJava_4 print the variables as shown above in the execution tab.

 

Variables are equals but  the "not" condition is always played.

vboppudi
Partner - Creator III
Partner - Creator III

so issue resolved ? if yes please mark it as solved.

 

Regards,

 

jcpreaux
Contributor II
Contributor II
Author

Hi,

 

The problem came from the way i compared my values in the if trigger.

 

I replace :

globalMap.get("CA_Stats") == globalMap.get("CA_Ventes")

By :

((BigDecimal)globalMap.get("CA_Stats")).compareTo(((BigDecimal)globalMap.get("CA_Ventes"))) == 0

 

And it works fine.

 

Thanks !

 

JCP