<?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: Filename from global var in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218051#M13410</link>
    <description>Yes, tFlowToIterate set a new value for each global variable each time the input row changes.</description>
    <pubDate>Thu, 24 Oct 2019 16:30:55 GMT</pubDate>
    <dc:creator>TRF</dc:creator>
    <dc:date>2019-10-24T16:30:55Z</dc:date>
    <item>
      <title>Filename from global var</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218048#M13407</link>
      <description>&lt;P&gt;Hi All.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I want to split a giant csv file into several smaller files according to the first three characters in the row. I have the following:&lt;/P&gt; 
&lt;P&gt;tFileInputFullRow --(row1)--&amp;gt; tJavaRow --(row2)--&amp;gt;tFileOutputRaw&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * rFileInputFullRow reads each line into a "line" column&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * tJavaRow reads:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; globalMap.put("rowType", row1.line.substring(1,4));&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; output_row.line = input_row.line;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * tFileOutputRaw has as filename "path/to"+((String)globalMap.get("rowType"))+".csv"&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;All I get as a result is a null.csv file staring back at me.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;However, when I do:&lt;/P&gt; 
&lt;P&gt;tFileInputFullRow --(row1)--&amp;gt; tMap -(row2)-&amp;gt; tFlowToIterate --(iterate)--&amp;gt;tFixedFlowInput--&amp;gt;tFileOutputDelimited&lt;/P&gt; 
&lt;P&gt;with&lt;/P&gt; 
&lt;P&gt;* tMap adding a new column type to row2 which is defined just as in the tJavaRow above&lt;/P&gt; 
&lt;P&gt;* tFileOutputDelimited has the same name as tFileOutputRaw.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;This time I do get the different files created!!&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Why does this happen? I'm asking this because I'm seeing that the first solution goes much quicker than the latter (mainly because it doesnt have to iterate each of the 50 columns for each of the 600.000+ rows).&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;cheers&lt;/P&gt; 
&lt;P&gt;David&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:16:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218048#M13407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filename from global var</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218049#M13408</link>
      <description>You need to break the process with tFlowToIterate else the output filename is computed only once when the subjob starts. Using tFlowToIterate you can change the filename on the flight but the process will be less fast.</description>
      <pubDate>Thu, 24 Oct 2019 15:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218049#M13408</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2019-10-24T15:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: Filename from global var</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218050#M13409</link>
      <description>&lt;P&gt;Even though the global variable is changed? (I have added another tJavaRow just to print the value of the global var and the value effectively changes each row...)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 15:39:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218050#M13409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-24T15:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filename from global var</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218051#M13410</link>
      <description>Yes, tFlowToIterate set a new value for each global variable each time the input row changes.</description>
      <pubDate>Thu, 24 Oct 2019 16:30:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Filename-from-global-var/m-p/2218051#M13410</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2019-10-24T16:30:55Z</dc:date>
    </item>
  </channel>
</rss>

