<?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 not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225479#M620985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint.&lt;/P&gt;&lt;P&gt;troubleshooting an issue i had and i used DISTINCT keyword to solve it.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue( DISTINCT "gross-cost",-"pr-date") &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I believe,Its picking random value out of same rank.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Sep 2018 16:39:45 GMT</pubDate>
    <dc:creator>nvrphanikumar</dc:creator>
    <dc:date>2018-09-12T16:39:45Z</dc:date>
    <item>
      <title>FirstSortedValue not working</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225477#M620983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me why the below does not always work.&lt;/P&gt;&lt;P&gt;Some codes are not given a "latest-gross-cost" even though there is always at least one price loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ProductPrice:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "gross-cost",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text("p-code") as "p-code",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "pr-date";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "gross-cost",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "p-code",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "pr-date"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM PUB.price;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INNER JOIN (ProductPrice)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "p-code",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Max("pr-date")) as "pr-date-max",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirstSortedValue("gross-cost",-"pr-date") as "latest-gross-cost"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Resident ProductPrice&lt;/P&gt;&lt;P&gt;Group by "p-code";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2017 10:34:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225477#M620983</guid>
      <dc:creator />
      <dc:date>2017-02-20T10:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue not working</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225478#M620984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1 data-mc-conditions="Primary.NotToTranslate" style="font-size: 1.714em; margin: 0 0 10px; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;FirstSortedValue - script function&lt;/H1&gt;&lt;P style="font-size: 14px; margin: 10px 0; color: #0f0f0f; font-family: 'Open Sans', Arial, sans-serif;"&gt;&lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;FirstSortedValue()&lt;/SPAN&gt; returns the value from the expression specified in &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;value&lt;/SPAN&gt; that corresponds to the result of sorting the &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;sort_weight&lt;/SPAN&gt; argument, taking into account &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;rank&lt;/SPAN&gt;, if specified.&lt;SPAN style="color: #ff0000;"&gt; If more than one resulting value shares the same &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;sort_weight&lt;/SPAN&gt; for the specified &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;rank&lt;/SPAN&gt;, the function returns &lt;SPAN class="statement" data-mc-conditions="Primary.NotToTranslate" style="font-weight: bold;"&gt;NULL&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe this is the case (highlighted in red)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Feb 2017 07:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225478#M620984</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-02-21T07:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue not working</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225479#M620985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the hint.&lt;/P&gt;&lt;P&gt;troubleshooting an issue i had and i used DISTINCT keyword to solve it.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue( DISTINCT "gross-cost",-"pr-date") &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I believe,Its picking random value out of same rank.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Sep 2018 16:39:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-not-working/m-p/1225479#M620985</guid>
      <dc:creator>nvrphanikumar</dc:creator>
      <dc:date>2018-09-12T16:39:45Z</dc:date>
    </item>
  </channel>
</rss>

