<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Changing the value of a variable set in tGlobalVar in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229606#M20496</link>
    <description>Hi
&lt;BR /&gt;In tJava, you can set a value to the global variable which you have defined on tGlobalVar, for example:
&lt;BR /&gt;tSetGlobalVar
&lt;BR /&gt; |
&lt;BR /&gt;onsuojobok
&lt;BR /&gt; |
&lt;BR /&gt;tJava
&lt;BR /&gt;on tSetGlobalVar, add a new variable let's call it "myKey" and set its value as "oldValue"
&lt;BR /&gt;on tJava, set a new value to global variable 'myKey" like this:
&lt;BR /&gt;globalMap.put("mykey", "newValue")
&lt;BR /&gt;You can use this variable in other component later as long as you declare a global variable before using it, call the variables in other component later like:
&lt;BR /&gt;(String)globalMap.get("myKey") //the data type of value is String
&lt;BR /&gt;(Integer)globalMap.get("myKey") //the data type of value is Integer/int
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
    <pubDate>Tue, 24 May 2011 06:31:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-05-24T06:31:17Z</dc:date>
    <item>
      <title>Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229605#M20495</link>
      <description>Hi guys,
&lt;BR /&gt;If I have a variable set using tGlobalVar example name and it's value is an empty string. How can I modify it using tJava?
&lt;BR /&gt;and if I ever declare a variable in tJava is it possible that can I call that variable in other components? If yes how? 
&lt;BR /&gt;
&lt;BR /&gt;Thanks,
&lt;BR /&gt;drixs</description>
      <pubDate>Sat, 16 Nov 2024 12:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229605#M20495</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229606#M20496</link>
      <description>Hi
&lt;BR /&gt;In tJava, you can set a value to the global variable which you have defined on tGlobalVar, for example:
&lt;BR /&gt;tSetGlobalVar
&lt;BR /&gt; |
&lt;BR /&gt;onsuojobok
&lt;BR /&gt; |
&lt;BR /&gt;tJava
&lt;BR /&gt;on tSetGlobalVar, add a new variable let's call it "myKey" and set its value as "oldValue"
&lt;BR /&gt;on tJava, set a new value to global variable 'myKey" like this:
&lt;BR /&gt;globalMap.put("mykey", "newValue")
&lt;BR /&gt;You can use this variable in other component later as long as you declare a global variable before using it, call the variables in other component later like:
&lt;BR /&gt;(String)globalMap.get("myKey") //the data type of value is String
&lt;BR /&gt;(Integer)globalMap.get("myKey") //the data type of value is Integer/int
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 24 May 2011 06:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229606#M20496</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-24T06:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229607#M20497</link>
      <description>Hi Shong,
&lt;BR /&gt;Just want to have a clarification.
&lt;BR /&gt;For example I've declared a variable in tJava:
&lt;BR /&gt;int record = 0;
&lt;BR /&gt;can i call this variable in other component?</description>
      <pubDate>Tue, 24 May 2011 07:52:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229607#M20497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-24T07:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229608#M20498</link>
      <description>Hi 
&lt;BR /&gt;No, only a global variable can be accessed on other component. As you done, define a global variable using tSetglobalVar component or use this expression: 
&lt;BR /&gt;globalMap.put("key","value") 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Tue, 24 May 2011 08:02:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229608#M20498</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-24T08:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229609#M20499</link>
      <description>Hi shong, 
&lt;BR /&gt;I have some problem here. 
&lt;BR /&gt;I declare a variable using a tSetGlobalVar : Key: PrevComb | Value:"novalue" 
&lt;BR /&gt;and here is my job outline 
&lt;BR /&gt;tSetGlobalVar 
&lt;BR /&gt; | 
&lt;BR /&gt; (Main) 
&lt;BR /&gt; | 
&lt;BR /&gt; tFlowToIterate 
&lt;BR /&gt; | 
&lt;BR /&gt; (Iterate) 
&lt;BR /&gt; | 
&lt;BR /&gt; tJava 
&lt;BR /&gt;In my tJava , I have a condition ((String)globalMap.get("CurrentComb")) != ((String)globalMap.get("PrevComb")) and if it's true it will be performing this: 
&lt;BR /&gt;globalMap.put("PrevComb" , ((String)globalMap.get("CurrentComb"))) 
&lt;BR /&gt;this means the CurrentComb value will be stored in PrevComb, am i right? 
&lt;BR /&gt;with this try to simulate in the next run it will be false because they have the same value, right? 
&lt;BR /&gt;But in my case on the next the result is true, it seems that PrevComb value is still "novalue". 
&lt;BR /&gt;Help me out thanks!</description>
      <pubDate>Wed, 25 May 2011 07:37:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229609#M20499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T07:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229610#M20500</link>
      <description>Just done a test and there's no value change in the variable</description>
      <pubDate>Wed, 25 May 2011 09:36:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229610#M20500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T09:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229611#M20501</link>
      <description>Hi 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;In my tJava , I have a condition ((String)globalMap.get("CurrentComb")) != ((String)globalMap.get("PrevComb"))&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;To determine whether one string is equals to another one, you should the use the method String.equals("anotherString"), so the expression should be: 
&lt;BR /&gt;((String)globalMap.get("CurrentComb")).equals(((String)globalMap.get("PrevComb"))) 
&lt;BR /&gt;BTW, for the numeric type, such as Integer/int, you can use ==. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 25 May 2011 10:00:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229611#M20501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T10:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229612#M20502</link>
      <description>Oh I see , Noted
&lt;BR /&gt;How about this issue:
&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;
 &lt;TABLE border="1"&gt;
  &lt;TBODY&gt;
   &lt;TR&gt;
    &lt;TD&gt;I declare a variable using a tSetGlobalVar : Key: PrevComb | Value:"novalue"&lt;BR /&gt;and here is my job outline&lt;BR /&gt;tSetGlobalVar&lt;BR /&gt; |&lt;BR /&gt; (Main)&lt;BR /&gt; |&lt;BR /&gt; tFlowToIterate&lt;BR /&gt; |&lt;BR /&gt; (Iterate)&lt;BR /&gt; |&lt;BR /&gt; tJava&lt;BR /&gt;&lt;BR /&gt;globalMap.put("PrevComb" , ((String)globalMap.get("CurrentComb")))&lt;BR /&gt;this means the CurrentComb value will be stored in PrevComb, am i right?&lt;BR /&gt;with this try to simulate in the next run it will be false because they have the same value, right?&lt;BR /&gt;But in my case on the next the result is true, it seems that PrevComb value is still "novalue".&lt;/TD&gt;
   &lt;/TR&gt;
  &lt;/TBODY&gt;
 &lt;/TABLE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 25 May 2011 10:20:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229612#M20502</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T10:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229613#M20503</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Oh I see , Noted&lt;BR /&gt;How about this issue:&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;;(, before you post this message, I think you shall to change the method equlas() as I said and test the job again. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Shong</description>
      <pubDate>Wed, 25 May 2011 10:55:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229613#M20503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-25T10:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229614#M20504</link>
      <description>&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;;(, before you post this message, I think you shall to change the method equlas() as I said and test the job again.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Omg! Sorry shong!! Wasnt able to reply it clearly because it's almost end of office hours. 
&lt;BR /&gt;Thanks for the .equals() shong! 
&lt;BR /&gt;one more question: 
&lt;BR /&gt;in this situation: 
&lt;BR /&gt;tGlobalSetVar: 
&lt;BR /&gt;key | value 
&lt;BR /&gt;count | 0 
&lt;BR /&gt; 
&lt;BR /&gt;tGlobalSetVar 
&lt;BR /&gt; | 
&lt;BR /&gt; Main 
&lt;BR /&gt; | 
&lt;BR /&gt; tFlowToIterate 
&lt;BR /&gt; | 
&lt;BR /&gt; iterate 
&lt;BR /&gt; | 
&lt;BR /&gt; tJava 
&lt;BR /&gt; 
&lt;BR /&gt;in tJava 
&lt;BR /&gt; globalMap.put("count" , ((Integer))globalMap.get("count") + 1 ); 
&lt;BR /&gt; 
&lt;BR /&gt;This is similar with count++; 
&lt;BR /&gt;right?</description>
      <pubDate>Fri, 27 May 2011 01:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229614#M20504</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-27T01:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229615#M20505</link>
      <description>Hi
&lt;BR /&gt;No, because it always set 'count' back to 0 on tGlobalSetVar, and set 'count' to 1 on tJava, so the value always is: 0,1,0,1...
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 27 May 2011 02:19:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229615#M20505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-27T02:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229616#M20506</link>
      <description>ohh.. so that's how it works.&lt;BR /&gt;Do you have any job layout which may similar above.</description>
      <pubDate>Fri, 27 May 2011 02:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229616#M20506</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-27T02:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229617#M20507</link>
      <description>Hi
&lt;BR /&gt;Yes, I done many similar jobs before, but it depends on your specific needs. Normally, I use the tJavaFlex component, for example:
&lt;BR /&gt;tFileInputDelimited---tJavaFlex--tLogRow
&lt;BR /&gt;on the begin part of tJavaFlex:
&lt;BR /&gt;int count=0;
&lt;BR /&gt;on the main part of tJavaFlex:
&lt;BR /&gt;count=count+1;
&lt;BR /&gt;on the end part of tJavaFlex, set the count to a global variable, so that it can be used later on other component:
&lt;BR /&gt;globalMap.put("count",count);
&lt;BR /&gt;Best regards
&lt;BR /&gt;Shong</description>
      <pubDate>Fri, 27 May 2011 02:37:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229617#M20507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-05-27T02:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Changing the value of a variable set in tGlobalVar</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229618#M20508</link>
      <description>&lt;P&gt;Hi I am retrieving an integer data from an Oracle table via tDBinput component. Then I am trying to assign it to a variable called vInvitationID using tGlobalVar ​component.  However during runtime it's retiring out saying I am assigning integer to a string. How do I resolve this problem?&lt;/P&gt;</description>
      <pubDate>Sat, 08 Aug 2020 04:30:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Changing-the-value-of-a-variable-set-in-tGlobalVar/m-p/2229618#M20508</guid>
      <dc:creator>Ravi_Rajagopal</dc:creator>
      <dc:date>2020-08-08T04:30:25Z</dc:date>
    </item>
  </channel>
</rss>

