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

tMap from two tSetGlobalVar

I have two tSetGlobalVar in which I store two different columns. NB_DNCL_OLD and NB_DNCL_NEW.

I am trying to connect them to a tMap component in order to have a single table as output, adding an expression for the difference between both integer variables. I am able to connect NB_DNCL_OLD as row3 (Main) to tMap but I am not allowed to connect NB_DNCL_NEW to the same tMap.

Should I use any component between the tSetGlobalVar and the tMap? What am I doing wrong? (I am new to Talend and I have no Java knowledge).

I have just recreated the tsetglobalvar and I have connected them to the tMap without connecting them to their sources (2 tFlowIterate) and this time I was able to connect the second one to the tMap through a lookup but, if I try to reconnect the tsetglobalvars to their sources I have the same problem: I am able to connect just the first as Main and I am not allowed to connect the second. Thanks for your advice.

 

 

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

tSetGlobalVar puts the var into a map that you can use anywhere in your job, you dont need to connect that component to anything.  You just refer to the variable by the key using the following syntax (casting to a string in this case):

(String) globalMap.get("key")

Where "key" is the name of the key you set in your tSetGlobalVar component.

So if you want to use this value in your tMap, in the output column you would put the expression above

View solution in original post

2 Replies
Anonymous
Not applicable
Author

tSetGlobalVar puts the var into a map that you can use anywhere in your job, you dont need to connect that component to anything.  You just refer to the variable by the key using the following syntax (casting to a string in this case):

(String) globalMap.get("key")

Where "key" is the name of the key you set in your tSetGlobalVar component.

So if you want to use this value in your tMap, in the output column you would put the expression above

Anonymous
Not applicable
Author

@evansdar Thank you for your answer! 0683p000009MACn.png

I have just erased the tMap and I am using my global variables and an expression to calculate the difference between them directly into the tSendMail component's message body. To have a little table with my current 3 variables I just set the MIME subtype to HTML and will insert the code.