<?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 FirstSortedValue Reverse (-Aggr) not working in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161629#M21054</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;P&gt;I have a function as a measure in a text box:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Distinct [Site Name], &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;that works and returns the Site with the lowest count of the ID variable. However, If I try to reverse this using either of the following methods:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Distinct [Site Name], -&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Distinct [Site Name], -1 * &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;I get a NULL return (i.e. a small dash and no result). Is anyone else to determine why?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;I attach a sample of the data in question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jul 2016 17:02:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-07-27T17:02:17Z</dc:date>
    <item>
      <title>FirstSortedValue Reverse (-Aggr) not working</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161629#M21054</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;P&gt;I have a function as a measure in a text box:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Distinct [Site Name], &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;that works and returns the Site with the lowest count of the ID variable. However, If I try to reverse this using either of the following methods:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Distinct [Site Name], -&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;OR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;FirstSortedValue(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Distinct [Site Name], -1 * &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;I get a NULL return (i.e. a small dash and no result). Is anyone else to determine why?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;I attach a sample of the data in question.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 17:02:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161629#M21054</guid>
      <dc:creator />
      <dc:date>2016-07-27T17:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Reverse (-Aggr) not working</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161630#M21055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i try and work witch &lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Distinct [Site Name], -&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Site Name]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 17:31:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161630#M21055</guid>
      <dc:creator />
      <dc:date>2016-07-27T17:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Reverse (-Aggr) not working</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161631#M21056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to be working for the sample provided&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/132732_Capture.PNG" style="height: 183px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 17:31:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161631#M21056</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-07-27T17:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue Reverse (-Aggr) not working</title>
      <link>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161632#M21057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your replies. It seems the problem was something in the data model. In my actual data I have something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="218"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="17" width="77"&gt;ID&lt;/TD&gt;&lt;TD width="77"&gt;Site Code&lt;/TD&gt;&lt;TD width="64"&gt;Site Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;1&lt;/TD&gt;&lt;TD align="right"&gt;1003&lt;/TD&gt;&lt;TD&gt;Site C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;2&lt;/TD&gt;&lt;TD align="right"&gt;1004&lt;/TD&gt;&lt;TD&gt;Site D&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;3&lt;/TD&gt;&lt;TD align="right"&gt;1002&lt;/TD&gt;&lt;TD&gt;Site B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="17"&gt;4&lt;/TD&gt;&lt;TD align="right"&gt;1004&lt;/TD&gt;&lt;TD&gt;Site D&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where Site Name was loaded from a different table and linked up using Site Code as the key. Site Name has some NULLS from some incomplete data. Site Code is fully complete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I do a count using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Distinct [Site Name], &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;-Aggr(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Count([ID]),&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;[Site Code]&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;it works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Thanks to all&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jul 2016 21:13:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/FirstSortedValue-Reverse-Aggr-not-working/m-p/1161632#M21057</guid>
      <dc:creator />
      <dc:date>2016-07-27T21:13:13Z</dc:date>
    </item>
  </channel>
</rss>

