<?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] tmap update current row with previosu row info in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204032#M5073</link>
    <description>I have been unsuccessfully trying to use tmap as the last part of a process, which I will summarize as follows: 
&lt;BR /&gt;The process extracts information from a Cobol proprietary system, w/o table maps. 
&lt;BR /&gt;As a result the only information available is in the form of a print formatted report. 
&lt;BR /&gt;The Java process have different sub jobs that do: a) clean headings b) create a row counter c) separate info (positional rows) according to 4 criteria (agent info, customer info, invoice info, transactions info). d) create 4 tab delimited files e) reassemble the files as tab delimited using the row counter as guide. 
&lt;BR /&gt;All successful. I end with a file looking like this(summary): 
&lt;BR /&gt;Record Record_type Agent Customer Invoice Transactions 
&lt;BR /&gt;1 1 aaaa 
&lt;BR /&gt;2 2 xxxxxx 
&lt;BR /&gt;3 3 FV-001 
&lt;BR /&gt;4 99 00111 
&lt;BR /&gt;5 99 00228 
&lt;BR /&gt;6 1 bbbb 
&lt;BR /&gt;7 2 yyyyyy 
&lt;BR /&gt;8 3 FV-002 
&lt;BR /&gt;9 99 00879 
&lt;BR /&gt;fields Record and Record_type are integer. Agent, Customer, Invoice and Transactions are String. Table is sorted by Agent, Customer and Invoice. 
&lt;BR /&gt;I have been unable to create a way in tmap to update the table rows in a way that keeps the first agent name while the agent name is null or empty string in the input flow and updates to the new agent name as input row agent is not null or not empty string: 
&lt;BR /&gt;tFileInputdelimited ---&amp;gt; tmap --&amp;gt; tFileOutputDelimited 
&lt;BR /&gt;Record Record_type Agent Customer Invoice Transactions 
&lt;BR /&gt;1 1 aaaa 
&lt;BR /&gt;2 2 aaaa xxxxxx 
&lt;BR /&gt;3 3 aaaa FV-001 
&lt;BR /&gt;4 99 aaaa 00111 
&lt;BR /&gt;5 99 aaaa 00228 
&lt;BR /&gt;6 1 bbbb 
&lt;BR /&gt;7 2 bbbb yyyyyy 
&lt;BR /&gt;8 3 bbbb FV-002 
&lt;BR /&gt;9 99 bbbb 00879 
&lt;BR /&gt;I have already searched throughout the forum and checked several related threads w/o success. Any help would be really appreciated 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;.</description>
    <pubDate>Sat, 16 Nov 2024 13:14:46 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:14:46Z</dc:date>
    <item>
      <title>[resolved] tmap update current row with previosu row info</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204032#M5073</link>
      <description>I have been unsuccessfully trying to use tmap as the last part of a process, which I will summarize as follows: 
&lt;BR /&gt;The process extracts information from a Cobol proprietary system, w/o table maps. 
&lt;BR /&gt;As a result the only information available is in the form of a print formatted report. 
&lt;BR /&gt;The Java process have different sub jobs that do: a) clean headings b) create a row counter c) separate info (positional rows) according to 4 criteria (agent info, customer info, invoice info, transactions info). d) create 4 tab delimited files e) reassemble the files as tab delimited using the row counter as guide. 
&lt;BR /&gt;All successful. I end with a file looking like this(summary): 
&lt;BR /&gt;Record Record_type Agent Customer Invoice Transactions 
&lt;BR /&gt;1 1 aaaa 
&lt;BR /&gt;2 2 xxxxxx 
&lt;BR /&gt;3 3 FV-001 
&lt;BR /&gt;4 99 00111 
&lt;BR /&gt;5 99 00228 
&lt;BR /&gt;6 1 bbbb 
&lt;BR /&gt;7 2 yyyyyy 
&lt;BR /&gt;8 3 FV-002 
&lt;BR /&gt;9 99 00879 
&lt;BR /&gt;fields Record and Record_type are integer. Agent, Customer, Invoice and Transactions are String. Table is sorted by Agent, Customer and Invoice. 
&lt;BR /&gt;I have been unable to create a way in tmap to update the table rows in a way that keeps the first agent name while the agent name is null or empty string in the input flow and updates to the new agent name as input row agent is not null or not empty string: 
&lt;BR /&gt;tFileInputdelimited ---&amp;gt; tmap --&amp;gt; tFileOutputDelimited 
&lt;BR /&gt;Record Record_type Agent Customer Invoice Transactions 
&lt;BR /&gt;1 1 aaaa 
&lt;BR /&gt;2 2 aaaa xxxxxx 
&lt;BR /&gt;3 3 aaaa FV-001 
&lt;BR /&gt;4 99 aaaa 00111 
&lt;BR /&gt;5 99 aaaa 00228 
&lt;BR /&gt;6 1 bbbb 
&lt;BR /&gt;7 2 bbbb yyyyyy 
&lt;BR /&gt;8 3 bbbb FV-002 
&lt;BR /&gt;9 99 bbbb 00879 
&lt;BR /&gt;I have already searched throughout the forum and checked several related threads w/o success. Any help would be really appreciated 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;.</description>
      <pubDate>Sat, 16 Nov 2024 13:14:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204032#M5073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmap update current row with previosu row info</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204033#M5074</link>
      <description>You can use a tJavaRow to save the previous value of the column, and then apply that in a tMap:&lt;BR /&gt;tFileInputdelimited ---&amp;gt; tJavaRow --&amp;gt; tmap --&amp;gt; tFileOutputDelimited&lt;BR /&gt;in the tJavaRow, save the value to the globalMap:&lt;BR /&gt;if(input_row.Agent != null &amp;amp;&amp;amp; !"".equals(input_row.Agent) ) {&lt;BR /&gt;    globalMap.put("Agent_prev_value",input_row.Agent);&lt;BR /&gt;}&lt;BR /&gt;Then in the tMap:&lt;BR /&gt;row2.Agent == null || "".equals(row2.Agent) ? (String)globalMap.get("Agent_prev_value") : row2.Agent</description>
      <pubDate>Tue, 19 Oct 2010 18:29:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204033#M5074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-19T18:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmap update current row with previosu row info</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204034#M5075</link>
      <description>John,
&lt;BR /&gt;Thank you for your quick reply. In the tmap you would put the expression in the variables area or in the output row area?</description>
      <pubDate>Tue, 19 Oct 2010 18:49:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204034#M5075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-19T18:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] tmap update current row with previosu row info</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204035#M5076</link>
      <description>I found out. It is in the output row area. I am posting a complete update with pictures in order to explain in detail what John instructed. Once again thanks to John. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt;. 
&lt;BR /&gt;All in all it works flawlesly.</description>
      <pubDate>Tue, 19 Oct 2010 19:05:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-tmap-update-current-row-with-previosu-row-info/m-p/2204035#M5076</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-10-19T19:05:05Z</dc:date>
    </item>
  </channel>
</rss>

