<?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: Keep only latest record in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626712#M595605</link>
    <description>&lt;P&gt;See attached&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2019 05:23:55 GMT</pubDate>
    <dc:creator>deshikas</dc:creator>
    <dc:date>2019-09-23T05:23:55Z</dc:date>
    <item>
      <title>Keep only latest record</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626603#M595601</link>
      <description>&lt;P&gt;I have raw data like below...&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee&lt;/TD&gt;&lt;TD&gt;Dept&lt;/TD&gt;&lt;TD&gt;YearMonth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Banking&lt;/TD&gt;&lt;TD&gt;201812&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Finance&lt;/TD&gt;&lt;TD&gt;201805&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Insurance&lt;/TD&gt;&lt;TD&gt;201808&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Banking&lt;/TD&gt;&lt;TD&gt;201803&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Finance&lt;/TD&gt;&lt;TD&gt;201805&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to keep the latest data only i.e latest record per employee per Dept per YearMonth like below&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee&lt;/TD&gt;&lt;TD&gt;Dept&lt;/TD&gt;&lt;TD&gt;YearMonth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Insurance&lt;/TD&gt;&lt;TD&gt;201808&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;Finance&lt;/TD&gt;&lt;TD&gt;201805&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to handle this scenario in QlikView &lt;STRONG&gt;script&lt;/STRONG&gt; only as there are many transformation. Here is the sample file with above data. Please suggest.&lt;/P&gt;&lt;P&gt;Test:&lt;BR /&gt;Load * INLINE&lt;BR /&gt;[Employee, Dept, YearMonth&lt;BR /&gt;A , Finance, 201805&lt;BR /&gt;A , Insurance, 201808&lt;BR /&gt;A , Banking, 201812&lt;BR /&gt;B , Finance, 201805&lt;BR /&gt;B , Banking, 201803];&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2019 19:40:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626603#M595601</guid>
      <dc:creator>safik003</dc:creator>
      <dc:date>2019-09-21T19:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only latest record</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626608#M595602</link>
      <description>&lt;P&gt;Take a look at the script below, but as you'll notice I where not sure if you wanted the latest transactions per user or latest YearPeriod per user.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Test:
Load rowno() as ID, * INLINE
[Employee, Dept, YearMonth
A        , Finance, 201805
A        , Insurance, 201808
A        , Banking, 201812
B		,  Finance, 201805
B		,  Banking, 201803];

INNER JOIN 
LOAD 
	Employee,
	Max(YearMonth) as YearMonth 	//Use if it is the lates YearMonth per employee
	//Max(ID) as ID  				//Use if it is the latest transaction that ist o be considered per empl.
Resident 
	Test
Group By 
	Employee;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 07:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626608#M595602</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-09-23T07:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only latest record</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626698#M595603</link>
      <description>Use aggr function taking expression as Yearmonth with dimension employee</description>
      <pubDate>Mon, 23 Sep 2019 03:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626698#M595603</guid>
      <dc:creator>AVINASH22</dc:creator>
      <dc:date>2019-09-23T03:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only latest record</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626712#M595605</link>
      <description>&lt;P&gt;See attached&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 05:23:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1626712#M595605</guid>
      <dc:creator>deshikas</dc:creator>
      <dc:date>2019-09-23T05:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Keep only latest record</title>
      <link>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1630166#M595606</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Safikul, did any of the posts help you get a working solution?&amp;nbsp; If so, please be sure to use the Accept as Solution button on the post(s) that did help you to give the poster credit and let others know which one(s) worked.&amp;nbsp; If you did something else, consider posting that and mark it the same way, and if you are still working upon things, leave an update.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Brett&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 16:30:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Keep-only-latest-record/m-p/1630166#M595606</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-10-01T16:30:08Z</dc:date>
    </item>
  </channel>
</rss>

