<?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 with equal values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58284#M9712</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more thought on this though:&lt;/P&gt;&lt;P&gt;What if one contact has 2 different values on the same day. Which one will it pick? And will it produce the same "issue"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Feb 2018 14:02:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-06T14:02:09Z</dc:date>
    <item>
      <title>FirstSortedValue with equal values</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58281#M9709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following table:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Wave&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ActivityDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ContactID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;NPSSegment&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Neutral&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Neutral&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Detractor&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;01/01/2018&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Promotor&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the following script:&lt;/P&gt;&lt;P style="font-size: 9px; font-family: 'Courier New'; color: #941100;"&gt;&lt;SPAN style="color: #000000;"&gt;NPSSegments:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;FirstSortedValue&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;(&lt;/SPAN&gt;NPSSegment&lt;SPAN style="color: #000000;"&gt;,-&lt;/SPAN&gt;ActivityDate&lt;SPAN style="color: #000000;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;NPSSegmentPre&lt;SPAN style="color: #000000;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008f00;"&gt;//avg(round(NPSScore)) as AvgNPSScore,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;/SPAN&gt;ContactID&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; NPSPreload&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;Where&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;Wave&lt;SPAN style="color: #000000;"&gt; = '0'&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;Group&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0433ff;"&gt;By&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;ContactID&lt;SPAN style="color: #000000;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;For ContactID A, there is no value. For B &amp;amp; C, there is. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The issue I'm having is with the ContactID A. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;How can I make the script "pick" one (the latest based on the sorting of the load script) when the activity date is the same?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Now it's just returning nothing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;As always, any help is greatly appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Kind regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Christophe&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 12:48:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58281#M9709</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-06T12:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with equal values</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58282#M9710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(&lt;SPAN style="color: #ff0000;"&gt;DISTINCT&lt;/SPAN&gt; NPSSegment,-ActivityDate) as NPSSegmentPre,&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 12:53:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58282#M9710</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-06T12:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with equal values</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58283#M9711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:00:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58283#M9711</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-06T14:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with equal values</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58284#M9712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One more thought on this though:&lt;/P&gt;&lt;P&gt;What if one contact has 2 different values on the same day. Which one will it pick? And will it produce the same "issue"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58284#M9712</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-06T14:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue with equal values</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58285#M9713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will pick on of them randomly. But is there a preference to what should be picked?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 14:04:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-with-equal-values/m-p/58285#M9713</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-02-06T14:04:13Z</dc:date>
    </item>
  </channel>
</rss>

