<?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: FirstSortedValue - return the max value... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029704#M347761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;='Max OrderDate:&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT OrderDate,Sale): ' &amp;amp; &lt;SPAN style="font-family: terminal,monaco;"&gt;&lt;STRONG style="color: #3366ff;"&gt;Date(Max({&amp;lt;Sale={"$(=Max(Sale))"}&amp;gt;}OrderDate))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Feb 2016 11:08:49 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2016-02-02T11:08:49Z</dc:date>
    <item>
      <title>FirstSortedValue - return the max value...</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029702#M347759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi all&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use the FirstSortedValue function - which I think is the correct function to use in my case, but am not able to achieve the correct result. In the example below I am trying to return the latest OrderDate for the max sales date, but based on the max sale value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As there are three order dates with the same max value of Sale (19.6) without using the 'DISTINCT' syntax the firstsortedvalue does not return a result. However as shown in the yellow box below I wish to return the date of 10/01/2016 (the most recent date that is associated with the max sale amount)&amp;nbsp; and &lt;STRONG&gt;not&lt;/STRONG&gt; the OrderDate of 05/01/2016.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas are most welcome!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="FSV.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113277_FSV.png" style="width: 620px; height: 260px;" /&gt; !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 10:52:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029702#M347759</guid>
      <dc:creator />
      <dc:date>2016-02-02T10:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue - return the max value...</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029703#M347760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=FirstSortedValue(DISTINCT OrderDate,-(Sale*100000+OrderDate))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/113278_Capture.PNG" style="height: 161px; width: 620px;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:08:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029703#M347760</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-02T11:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue - return the max value...</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029704#M347761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;='Max OrderDate:&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT OrderDate,Sale): ' &amp;amp; &lt;SPAN style="font-family: terminal,monaco;"&gt;&lt;STRONG style="color: #3366ff;"&gt;Date(Max({&amp;lt;Sale={"$(=Max(Sale))"}&amp;gt;}OrderDate))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:08:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-return-the-max-value/m-p/1029704#M347761</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-02-02T11:08:49Z</dc:date>
    </item>
  </channel>
</rss>

