<?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: How do I return latest date by employee as new script field or by filtering out older dates? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1977202#M1220841</link>
    <description>&lt;P&gt;Possibly this using FirstSortedValue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TEmployeeTable:
LOAD *Inline[
Employee ID,Name,Review Date
1234,Jo bloggs,01/04/2020
1234,Jo bloggs,31/03/2022
];

NoConcatenate
EmployeeTable:
LOAD Distinct [Employee ID], 
Name,
FirstSortedValue([Review Date],-[Review Date]) as [Review Date]
Resident TEmployeeTable
Group By [Employee ID],Name
Order By [Employee ID];

DROP Table TEmployeeTable;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;SPAN data-mc-conditions="Targets.NotToTranslate"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/H1&gt;</description>
    <pubDate>Tue, 06 Sep 2022 03:40:55 GMT</pubDate>
    <dc:creator>BrunPierre</dc:creator>
    <dc:date>2022-09-06T03:40:55Z</dc:date>
    <item>
      <title>How do I return latest date by employee as new script field or by filtering out older dates?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1976884#M1220820</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm loading employee data from an excel file (about 20 fields). One field displays review dates. For some employees there is more than one record. How do I return only the latest review date for them, or stop unrequired, older dates (for employees with more than one date) from being loaded at all? I thought firstsortedvalue might be the solution, but I can't get it to work.&lt;/P&gt;
&lt;P&gt;In the example below, I want only the later date loaded into the script, or it can be returned in a&amp;nbsp; new field.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="reviewdate.JPG" style="width: 380px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/88262iB5EAC5E1E74CC432/image-size/large?v=v2&amp;amp;px=999" role="button" title="reviewdate.JPG" alt="reviewdate.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Many thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2022 11:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1976884#M1220820</guid>
      <dc:creator>zakpullen</dc:creator>
      <dc:date>2022-09-05T11:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I return latest date by employee as new script field or by filtering out older dates?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1977167#M1220839</link>
      <description>&lt;P&gt;You can do this by creating an aggregation table to aggregate [Review Date] by [Employee ID] ..&lt;/P&gt;&lt;P&gt;Load [Employee ID],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Max([Review Date]) as [Latest Review Date]&lt;BR /&gt;Resident TableName&lt;BR /&gt;group by [Employee ID];&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 00:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1977167#M1220839</guid>
      <dc:creator>Lisa_P</dc:creator>
      <dc:date>2022-09-06T00:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I return latest date by employee as new script field or by filtering out older dates?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1977202#M1220841</link>
      <description>&lt;P&gt;Possibly this using FirstSortedValue&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TEmployeeTable:
LOAD *Inline[
Employee ID,Name,Review Date
1234,Jo bloggs,01/04/2020
1234,Jo bloggs,31/03/2022
];

NoConcatenate
EmployeeTable:
LOAD Distinct [Employee ID], 
Name,
FirstSortedValue([Review Date],-[Review Date]) as [Review Date]
Resident TEmployeeTable
Group By [Employee ID],Name
Order By [Employee ID];

DROP Table TEmployeeTable;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;SPAN data-mc-conditions="Targets.NotToTranslate"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/H1&gt;</description>
      <pubDate>Tue, 06 Sep 2022 03:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1977202#M1220841</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2022-09-06T03:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I return latest date by employee as new script field or by filtering out older dates?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1978549#M1220890</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 08:54:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-return-latest-date-by-employee-as-new-script-field-or/m-p/1978549#M1220890</guid>
      <dc:creator>zakpullen</dc:creator>
      <dc:date>2022-09-08T08:54:15Z</dc:date>
    </item>
  </channel>
</rss>

