<?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 [resolved] Generating multiple rows with tJava in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337122#M105495</link>
    <description>&lt;P&gt;I've read similar threads to this, but nothing that quite answers my question. I'm trying to create a tJava that takes in a table and outputs a table for use by a tmap that will grab data from other tables. I need it to do this:&lt;BR /&gt;&lt;BR /&gt;for (in_row : plan_row) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = in_row.StartYear;i &amp;lt;= in_row.EndYear;i++) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; out_row.plan_id = in_row.id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; out_row.year = i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; makeThisARow(out_row);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;So input can look like this:&lt;BR /&gt;plan_id start_year end_year&lt;BR /&gt;1, 2016, 2018&lt;BR /&gt;&lt;BR /&gt;And output like this:&lt;BR /&gt;1, 2016&lt;BR /&gt;1, 2017&lt;BR /&gt;1, 2018&lt;BR /&gt;&lt;BR /&gt;I don't understand how to interact with the components connected to the tJava. How do I tell it 'give me each row' and 'create a row'?&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2016 22:34:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-07T22:34:11Z</dc:date>
    <item>
      <title>[resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337122#M105495</link>
      <description>&lt;P&gt;I've read similar threads to this, but nothing that quite answers my question. I'm trying to create a tJava that takes in a table and outputs a table for use by a tmap that will grab data from other tables. I need it to do this:&lt;BR /&gt;&lt;BR /&gt;for (in_row : plan_row) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = in_row.StartYear;i &amp;lt;= in_row.EndYear;i++) {&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; out_row.plan_id = in_row.id;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; out_row.year = i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; makeThisARow(out_row);&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;BR /&gt;So input can look like this:&lt;BR /&gt;plan_id start_year end_year&lt;BR /&gt;1, 2016, 2018&lt;BR /&gt;&lt;BR /&gt;And output like this:&lt;BR /&gt;1, 2016&lt;BR /&gt;1, 2017&lt;BR /&gt;1, 2018&lt;BR /&gt;&lt;BR /&gt;I don't understand how to interact with the components connected to the tJava. How do I tell it 'give me each row' and 'create a row'?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 22:34:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337122#M105495</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-07T22:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337123#M105496</link>
      <description>I think this might lead you in the right direction. You just need to change the code in the tJavaFlex to accommodate your requirements.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="https://www.rilhia.com/quicktips/quick-tip-row-multiplication" rel="nofollow noopener noreferrer"&gt;https://www.rilhia.com/quicktips/quick-tip-row-multiplication&lt;/A&gt;</description>
      <pubDate>Wed, 07 Sep 2016 23:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337123#M105496</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-07T23:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337124#M105497</link>
      <description>&lt;BLOCKQUOTE&gt;
  rhall_2.0 wrote: 
 &lt;BR /&gt;I think this might lead you in the right direction. You just need to change the code in the tJavaFlex to accommodate your requirements. 
 &lt;BR /&gt; 
 &lt;BR /&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;I found this link earlier and have been trying to solve the problem that was as well, but that gives me a different problem: 
&lt;BR /&gt; 
&lt;BR /&gt;//start 
&lt;BR /&gt;for(short i = ((Short)globalMap.get("StartYear")).shortValue();i&amp;lt;((Short)globalMap.get("EndYear")).shortValue(); i++){&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;//main 
&lt;BR /&gt;map_row.plan_id = ((Integer)globalMap.get("id")).intValue(); 
&lt;BR /&gt;map_row.year = i; 
&lt;BR /&gt;//end 
&lt;BR /&gt;} 
&lt;BR /&gt; 
&lt;BR /&gt;How do I get 'i' inside the main. 
&lt;BR /&gt; 
&lt;BR /&gt;On a related note, is there some way to tell the IDE to show me the generated code?</description>
      <pubDate>Thu, 08 Sep 2016 00:00:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337124#M105497</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-08T00:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337125#M105498</link>
      <description>That code should work. What error are you getting?&lt;BR /&gt;&lt;BR /&gt;You will see a "code" tab in the bottom left hand corner of the design window. Click that to see the code.</description>
      <pubDate>Thu, 08 Sep 2016 00:24:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337125#M105498</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-08T00:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337126#M105499</link>
      <description>&lt;BLOCKQUOTE&gt;
 rhall_2.0 wrote:
 &lt;BR /&gt;That code should work. What error are you getting?
 &lt;BR /&gt;
 &lt;BR /&gt;You will see a "code" tab in the bottom left hand corner of the design window. Click that to see the code.
&lt;/BLOCKQUOTE&gt;
&lt;BR /&gt;Arg, that should have been obvious.
&lt;BR /&gt;
&lt;BR /&gt;java.lang.NullPointerException, globalMap("StartYear") is null for some reason.</description>
      <pubDate>Thu, 08 Sep 2016 01:22:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337126#M105499</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-08T01:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337127#M105500</link>
      <description>OK, if you followed my tutorial I suspect that is being set in the tMap. Is that correct? Can you take a screenshot of your job and your tMap so that I can see what might be wrong?</description>
      <pubDate>Thu, 08 Sep 2016 08:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337127#M105500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-08T08:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Generating multiple rows with tJava</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337128#M105501</link>
      <description>I see what it is now...someone actually set a StartYear to null. I thought there was a constraint against that (there should be).
&lt;BR /&gt;It works now. Thanks for your help!</description>
      <pubDate>Thu, 08 Sep 2016 15:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Generating-multiple-rows-with-tJava/m-p/2337128#M105501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-08T15:46:16Z</dc:date>
    </item>
  </channel>
</rss>

