<?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 How to group and only return single row for each group in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358550#M123556</link>
    <description>&lt;P&gt;I need to group and then filter out certain rows of data within&amp;nbsp;each group and I am struggling on how to achieve this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is some data (columns on top):&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Id, lastmodifieddate, relatedto,address&lt;/P&gt; 
&lt;P&gt;1,2017-1-1,X,address1&lt;/P&gt; 
&lt;P&gt;2, 2015-1-1,Y,address2&lt;/P&gt; 
&lt;P&gt;3, 2017-6-6,X,address3&lt;/P&gt; 
&lt;P&gt;4, 2015-1-1,Z,address4&lt;/P&gt; 
&lt;P&gt;5, 2014-1-1,Y,address5&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this case, I want to group the records by relatedto and then only return the record with the most recent lastmodifieddate. So, for the example above, I want the results to only return 3 records as shown below:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Id,&amp;nbsp;&lt;/SPAN&gt;lastmodifieddate&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;relatedto,address&lt;/P&gt; 
&lt;P&gt;2, 2015-1-1,Y,address2&lt;/P&gt; 
&lt;P&gt;3, 2017-6-6,X&lt;SPAN&gt;,address3&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;4, 2015-1-1,Z,address4&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I used&amp;nbsp;tAggregateRow&amp;nbsp;with group by relatedto&amp;nbsp;and max operation on lastmodified date to get the row. However, when I use the tLogRow component to log the output, I only see the relatedTo&amp;nbsp;and lastmodified column, but the Id and address columns are null.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I get the Id and address column to show the value for the row that has the latest lastmodified date for each relatedto?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am new to Talend so be kind &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 30 Jul 2017 03:55:20 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-07-30T03:55:20Z</dc:date>
    <item>
      <title>How to group and only return single row for each group</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358550#M123556</link>
      <description>&lt;P&gt;I need to group and then filter out certain rows of data within&amp;nbsp;each group and I am struggling on how to achieve this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is some data (columns on top):&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Id, lastmodifieddate, relatedto,address&lt;/P&gt; 
&lt;P&gt;1,2017-1-1,X,address1&lt;/P&gt; 
&lt;P&gt;2, 2015-1-1,Y,address2&lt;/P&gt; 
&lt;P&gt;3, 2017-6-6,X,address3&lt;/P&gt; 
&lt;P&gt;4, 2015-1-1,Z,address4&lt;/P&gt; 
&lt;P&gt;5, 2014-1-1,Y,address5&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this case, I want to group the records by relatedto and then only return the record with the most recent lastmodifieddate. So, for the example above, I want the results to only return 3 records as shown below:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Id,&amp;nbsp;&lt;/SPAN&gt;lastmodifieddate&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;relatedto,address&lt;/P&gt; 
&lt;P&gt;2, 2015-1-1,Y,address2&lt;/P&gt; 
&lt;P&gt;3, 2017-6-6,X&lt;SPAN&gt;,address3&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;4, 2015-1-1,Z,address4&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I used&amp;nbsp;tAggregateRow&amp;nbsp;with group by relatedto&amp;nbsp;and max operation on lastmodified date to get the row. However, when I use the tLogRow component to log the output, I only see the relatedTo&amp;nbsp;and lastmodified column, but the Id and address columns are null.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;How can I get the Id and address column to show the value for the row that has the latest lastmodified date for each relatedto?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I am new to Talend so be kind &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thank you.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 03:55:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358550#M123556</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-30T03:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to group and only return single row for each group</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358551#M123557</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The simplest solution (here the input is from tFixedFlowInput for testing):&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lw92.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157168i7256B94EE27A8C23/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lw92.png" alt="0683p000009Lw92.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;- tSortRow to order records on&amp;nbsp;&lt;SPAN&gt;lastmodifieddate descending order&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;- tUniqRow to eliminate&amp;nbsp;duplicate records on relatedto&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;- tSortRow&amp;nbsp;to order records on id ascending order&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;That's all&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 18:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358551#M123557</guid>
      <dc:creator>TRF</dc:creator>
      <dc:date>2017-07-30T18:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to group and only return single row for each group</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358552#M123558</link>
      <description>&lt;P&gt;Thank you TRF.&lt;/P&gt;&lt;P&gt;I was missing the tUniqRow&amp;nbsp;piece.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jul 2017 22:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-group-and-only-return-single-row-for-each-group/m-p/2358552#M123558</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-07-30T22:00:57Z</dc:date>
    </item>
  </channel>
</rss>

