<?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: Excel - output one row from multiple rows in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255157#M37947</link>
    <description>Thank you so much. This was exactly what I needed and was very helpful to me!</description>
    <pubDate>Fri, 25 Oct 2013 12:37:05 GMT</pubDate>
    <dc:creator>jmceachern</dc:creator>
    <dc:date>2013-10-25T12:37:05Z</dc:date>
    <item>
      <title>Excel - output one row from multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255155#M37945</link>
      <description>I am new to Talend and have a DI scenario that I'm looking for help with. My input Excel s/sheet is in this format:
&lt;BR /&gt;Account Description Amount
&lt;BR /&gt;12345 Transfer 100.00
&lt;BR /&gt; Tax 50.00
&lt;BR /&gt;23232 Transfer 200.00
&lt;BR /&gt; Tax 75.00
&lt;BR /&gt;And I need my output Excel s/sheet in this format:
&lt;BR /&gt;Account Amount Tax
&lt;BR /&gt;12345 100.00 50.00
&lt;BR /&gt;23232 200.00 75.00
&lt;BR /&gt;Two rows in the input s/sheet will generate one row in the output s/sheet.
&lt;BR /&gt;What is the easiest way for me to this with Talend?</description>
      <pubDate>Wed, 23 Oct 2013 16:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255155#M37945</guid>
      <dc:creator>jmceachern</dc:creator>
      <dc:date>2013-10-23T16:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Excel - output one row from multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255156#M37946</link>
      <description>I would use the tFileExcelSheetInput component (from Talend Exchange) to read the excel file and configure the column Account to get always the last not empty value. This way you will get this:
&lt;BR /&gt;Account Description Amount
&lt;BR /&gt;12345 Transfer 100.00
&lt;BR /&gt;12345 Tax 50.00
&lt;BR /&gt;23232 Transfer 200.00
&lt;BR /&gt;23232 Tax 75.00
&lt;BR /&gt;send this inputflow to a tMap.
&lt;BR /&gt;In the tMap add an output flow with these columns:
&lt;BR /&gt;Account Amount Tax
&lt;BR /&gt;Now create a new output flow out2 as joined output for out1.
&lt;BR /&gt;For the first flow map the input Amount to output Amount and Account to Account.
&lt;BR /&gt;For the second flow map the input Amount to Tax and Account to Account.
&lt;BR /&gt;The output flow out1 now send to an tAggregateSortedRow componente and take care you get the sum of Amount and Tax and use Account as key field. Because of only one row has a value and the other is null you get the wanted value.
&lt;BR /&gt;This way you will get your desired result.
&lt;BR /&gt;tFileExcelWorkbookOpen --OnSubjobOK--&amp;gt; tFileExcelSheetInput ---&amp;gt; tMap ---&amp;gt; tAggregateSortedRow --&amp;gt; tFileOutputExcel (your target excel file)</description>
      <pubDate>Wed, 23 Oct 2013 18:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255156#M37946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-23T18:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Excel - output one row from multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255157#M37947</link>
      <description>Thank you so much. This was exactly what I needed and was very helpful to me!</description>
      <pubDate>Fri, 25 Oct 2013 12:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255157#M37947</guid>
      <dc:creator>jmceachern</dc:creator>
      <dc:date>2013-10-25T12:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: Excel - output one row from multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255158#M37948</link>
      <description>Hi jmceachern 
&lt;BR /&gt;With the functionality "Use last value for empty" of tFileExcelSheetInput developed and shared by jlolling, it is easy to filling the Account column with last value when it is empty or null, that's great! 
&lt;BR /&gt;Here I give you another solution without using a custom component as a reference: store the current Account into memory for used later when the Account is empty or null, please see my screenshots. 
&lt;BR /&gt;expression of Account column of out1: 
&lt;BR /&gt; 
&lt;PRE&gt;row1.Account==null?(Integer)globalMap.get("last_account"):row1.Account&lt;/PRE&gt; 
&lt;BR /&gt;code on tJavaRow: 
&lt;BR /&gt; 
&lt;PRE&gt;if(input_row.Account!=null){&lt;BR /&gt;globalMap.put("last_account",input_row.Account);&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;Shong 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/155990i96BC042222D79B3E/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXI.png" alt="0683p000009MBXI.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBXN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/139983i59B840C937A536DC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBXN.png" alt="0683p000009MBXN.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MBFz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/128197i0094BE6F22AD3E93/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MBFz.png" alt="0683p000009MBFz.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Fri, 25 Oct 2013 15:40:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255158#M37948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-25T15:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Excel - output one row from multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255159#M37949</link>
      <description>Thank you so much, shong! This is also very helpful.</description>
      <pubDate>Fri, 25 Oct 2013 15:43:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Excel-output-one-row-from-multiple-rows/m-p/2255159#M37949</guid>
      <dc:creator>jmceachern</dc:creator>
      <dc:date>2013-10-25T15:43:17Z</dc:date>
    </item>
  </channel>
</rss>

