<?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: Using local variable in tmap expression builder in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297280#M69871</link>
    <description>&lt;P&gt;I think, I will have to learn java, I cannot avoid it.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For the string array declaration/definition I already figured out, what is the right way:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;String numbers_strarray[] = {"service1", row3.service1};&lt;/PRE&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding, how to return this array is still a question.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 20:49:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-06-26T20:49:12Z</dc:date>
    <item>
      <title>Using local variable in tmap expression builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297278#M69869</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;I tried to create local variable(s) inside the expression builder, to get an array of strings as return value:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kijelölés_015.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lv6q.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151596i2351A11D1A9AC7A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lv6q.png" alt="0683p000009Lv6q.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As I just started using Talend, the idea above is not working.&lt;/P&gt; 
&lt;P&gt;Error messages:&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;&lt;FONT color="#FF0000"&gt;Syntax error on tokens, ReferenceType expected instead&amp;nbsp;&lt;/FONT&gt; (mouse over the String[] text)&lt;/LI&gt; 
 &lt;LI&gt;&lt;FONT color="#FF0000"&gt;Syntax error, insert "VariableDeclarators" to complete LocalVariableDeclaration&lt;/FONT&gt; (mouse over the numbers_strarray)&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;My questions:&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;is it possible to create a local variable somehow to be able to&amp;nbsp; write complex "scripts" instead of input field - output field?&lt;/LI&gt; 
 &lt;LI&gt;if yes, where can I found working example/documentation of it or what to write in the example above to get it work?&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;I feel I really miss something trivial.&lt;/P&gt; 
&lt;P&gt;Thanks,&lt;/P&gt; 
&lt;P&gt;István&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 18:26:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297278#M69869</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-26T18:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using local variable in tmap expression builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297279#M69870</link>
      <description>&lt;P&gt;Paging&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;, will&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;please pick up a white courtesy phone...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 20:08:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297279#M69870</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-06-26T20:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using local variable in tmap expression builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297280#M69871</link>
      <description>&lt;P&gt;I think, I will have to learn java, I cannot avoid it.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;For the string array declaration/definition I already figured out, what is the right way:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;String numbers_strarray[] = {"service1", row3.service1};&lt;/PRE&gt; 
&lt;P&gt;&lt;FONT color="#000000"&gt;Regarding, how to return this array is still a question.&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 20:49:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297280#M69871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-26T20:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using local variable in tmap expression builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297281#M69872</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've personaly never seen it before (not saying it's impossible).&lt;/P&gt;&lt;P&gt;Can you give us some information about your use case?&amp;nbsp;&lt;/P&gt;&lt;P&gt;What do you expect? How are the input data? What is the expected result?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 21:17:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297281#M69872</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-06-26T21:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using local variable in tmap expression builder</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297282#M69873</link>
      <description>&lt;P&gt;For the complex scripts (and even complex data types) look at Routines. You can write your own Java classes and use with the expression builder. I have several tutorials of differing complexity on my website, but this one may be of interest for a simple example using a Routine (&lt;A href="https://www.rilhia.com/tutorials/creating-random-test-data-using-talend-data-integration" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.rilhia.com/tutorials/creating-random-test-data-using-talend-data-integration&lt;/A&gt;).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;To do what you are trying to do, you need to think in a different way. In the expression builder, you can only use one line of Java code at a time. This makes it trickier to work with, but there are always workarounds (a Routine is a good workaround). &amp;nbsp;What you are trying to build is a String array. This might be tricky (impossible I would suggest) in the way you are trying it. But you can use a Routine for this OR use an ArrayList to achieve this. Talend actually implements a List data type which is essentially&amp;nbsp;the java.util.List class.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Another thing I will suggest is that if you are new to Talend, maybe ask us about your requirement. A lot of the time there is a different way of solving a problem in Talend that new users do not realise. It might be that you are making this a little more complicated than it needs to be. &amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 11:39:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-local-variable-in-tmap-expression-builder/m-p/2297282#M69873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-06-27T11:39:06Z</dc:date>
    </item>
  </channel>
</rss>

