<?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 question. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969185#M647396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Here is an extract from the Reference Manual. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;firstsortedvalue ( [ distinct ] expression [, sort-weight [, n ]] )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;returns the first value of expression sorted by corresponding sortweight&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;when expression is iterated over a number of records as&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;defined by a group by clause. Sort-weight should return a numeric&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;value where the lowest value will render the corresponding value of&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;expression to be sorted first. By preceding the sort-value expression&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;with a minus sign, the function will return the last value instead. If&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;more than one value of expression share the same lowest sort-order,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;the function will return null. By stating an n larger than 1, you will&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;get the nth value in order. If the word distinct occurs before the&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;expression, all duplicates will be disregarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Oct 2015 13:25:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-10-13T13:25:47Z</dc:date>
    <item>
      <title>Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969180#M647385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to find out city for which I have maximum Applications. Each application has a unique id : AppId. My expression returns null.&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;Expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;vFirstCity=FirstSortedValue (City,Aggr(Count(AppId),City )) &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:19:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969180#M647385</guid>
      <dc:creator />
      <dc:date>2015-10-13T12:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969181#M647388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For max you will need a negative sign next to the Aggr function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vFirstCity=FirstSortedValue(City, -Aggr(Count(AppId), City))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:43:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969181#M647388</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-10-13T12:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969182#M647391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for quick revert.Extremely silly mistake.Anyway to get any value if there are multiple cities with same count ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:48:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969182#M647391</guid>
      <dc:creator />
      <dc:date>2015-10-13T12:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969183#M647392</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;Yes for Maximum value,minus sign should be used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;vFirstCity=FirstSortedValue(City, -Aggr(Count(AppId), City))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&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;if you get multiple values then FirstSortedValue() will return null.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 12:52:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969183#M647392</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-13T12:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969184#M647394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use a Concat() function to see them all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Concat(Aggr(FirstSortedValue(City, -Aggr(Count(AppId), City)), City), ', ')&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 13:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969184#M647394</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-10-13T13:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969185#M647396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hi,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Here is an extract from the Reference Manual. Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;firstsortedvalue ( [ distinct ] expression [, sort-weight [, n ]] )&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;returns the first value of expression sorted by corresponding sortweight&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;when expression is iterated over a number of records as&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;defined by a group by clause. Sort-weight should return a numeric&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;value where the lowest value will render the corresponding value of&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;expression to be sorted first. By preceding the sort-value expression&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;with a minus sign, the function will return the last value instead. If&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;more than one value of expression share the same lowest sort-order,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;the function will return null. By stating an n larger than 1, you will&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;get the nth value in order. If the word distinct occurs before the&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;expression, all duplicates will be disregarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 13:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969185#M647396</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-10-13T13:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969186#M647397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can choose a second criteria, dividing by a large number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;FirstSortedValue(City, -Aggr(Count(AppId), City) + count(otherfield)/10000 )&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 13:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969186#M647397</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-10-13T13:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue question.</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969187#M647398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes sense. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 13:31:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-question/m-p/969187#M647398</guid>
      <dc:creator />
      <dc:date>2015-10-13T13:31:48Z</dc:date>
    </item>
  </channel>
</rss>

