<?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/633178#M232282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may be that multiple CustomerListID's have the same lowest sum, in which case firstsortedvalue will return a null.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ffffff; font-size: 10pt; background-color: #3399ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;firstsortedvalue&lt;/SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="Italic" style="font-size: 10pt; line-height: 1.5em;"&gt;[{set_expression}][ &lt;SPAN class="Bold"&gt;distinct&lt;/SPAN&gt; ] [ &lt;SPAN class="Bold"&gt;total&lt;/SPAN&gt; [&amp;lt;fld {, fld}&amp;gt;]] expression [, sort_weight [, n]]&lt;/SPAN&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;returns the first value of &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; sorted by corresponding &lt;SPAN class="Italic"&gt;sort-weight&lt;/SPAN&gt; when &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; is iterated over the chart dimension(s). &lt;SPAN class="Italic"&gt;Sort-weight&lt;/SPAN&gt; should return a numeric value where the lowest value will render the corresponding value of &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; to be sorted first. By preceding the &lt;SPAN class="Italic"&gt;sort-value&lt;/SPAN&gt; expression with a minus sign, the function will return the last value instead. &lt;STRONG&gt;If more than one value of expression share the same lowest &lt;SPAN class="Italic"&gt;sort-order&lt;/SPAN&gt;, the function will return null.&lt;/STRONG&gt; By stating an n larger than 1, you will get the nth value in order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't help, try to post an example that demonstrates your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 May 2014 19:39:39 GMT</pubDate>
    <dc:creator>jerem1234</dc:creator>
    <dc:date>2014-05-29T19:39:39Z</dc:date>
    <item>
      <title>FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633177#M232281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I got expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;FirstSortedValue(CustomerListID,(Aggr(&lt;SPAN style="color: #ff0000;"&gt;sum&lt;/SPAN&gt;({$&amp;lt;AccountType={'Income'}&amp;gt;}Transactions.Amount),CustomerListID)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intent of this expression is show me the customer with lowest total sales.&lt;/P&gt;&lt;P&gt;FIrstSortedValue returns NULL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when I use &lt;SPAN style="; color: #ff0000;"&gt;&lt;STRONG&gt;min&lt;/STRONG&gt;&lt;/SPAN&gt; instead of &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;sum &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;STRONG&gt;FirstSortedValue(CustomerListID,(Aggr(&lt;SPAN style="color: #ff0000;"&gt;min&lt;/SPAN&gt;({$&amp;lt;AccountType={'Income'}&amp;gt;}Amount), CustomerListID)))&lt;/STRONG&gt; then I get correct value returned....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is going on here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Saurabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:14:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633177#M232281</guid>
      <dc:creator />
      <dc:date>2014-05-29T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633178#M232282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It may be that multiple CustomerListID's have the same lowest sum, in which case firstsortedvalue will return a null.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #ffffff; font-size: 10pt; background-color: #3399ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="color: #ffffff; background-color: #3399ff;"&gt;firstsortedvalue&lt;/SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="Italic" style="font-size: 10pt; line-height: 1.5em;"&gt;[{set_expression}][ &lt;SPAN class="Bold"&gt;distinct&lt;/SPAN&gt; ] [ &lt;SPAN class="Bold"&gt;total&lt;/SPAN&gt; [&amp;lt;fld {, fld}&amp;gt;]] expression [, sort_weight [, n]]&lt;/SPAN&gt;&lt;SPAN class="Bold" style="font-size: 10pt; line-height: 1.5em;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;returns the first value of &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; sorted by corresponding &lt;SPAN class="Italic"&gt;sort-weight&lt;/SPAN&gt; when &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; is iterated over the chart dimension(s). &lt;SPAN class="Italic"&gt;Sort-weight&lt;/SPAN&gt; should return a numeric value where the lowest value will render the corresponding value of &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; to be sorted first. By preceding the &lt;SPAN class="Italic"&gt;sort-value&lt;/SPAN&gt; expression with a minus sign, the function will return the last value instead. &lt;STRONG&gt;If more than one value of expression share the same lowest &lt;SPAN class="Italic"&gt;sort-order&lt;/SPAN&gt;, the function will return null.&lt;/STRONG&gt; By stating an n larger than 1, you will get the nth value in order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this doesn't help, try to post an example that demonstrates your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:39:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633178#M232282</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-05-29T19:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Re: FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633179#M232283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;That's helpful....especially this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;"Sort-weight&lt;/SPAN&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;&lt;SPAN style="color: #3d3d3d;"&gt; should return a numeric value where the lowest value will render the corresponding value of &lt;/SPAN&gt;&lt;SPAN class="Italic" style="color: #3d3d3d;"&gt;expression&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt; to be sorted first. "&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 12pt; font-family: calibri, verdana, arial, sans-serif;"&gt;But does it mean we can not sort by Dates...or Qlikview&amp;nbsp; will return the number representation of dates when it used in this function....or do we need to handle it our side...&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 19:56:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633179#M232283</guid>
      <dc:creator />
      <dc:date>2014-05-29T19:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633180#M232284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works on dates; it will take the number representation of the date (since dates are pretty much dual values).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 20:00:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633180#M232284</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-05-29T20:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: Re: FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633181#M232285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is wring with it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FirstSortedValue(Date(TxnDate), Aggr(Min({&amp;lt;AccountType={'Income'}&amp;gt;TxnDate),CustomerListID))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the minimum transaction date for a customer...but it does not work....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 22:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633181#M232285</guid>
      <dc:creator />
      <dc:date>2014-05-29T22:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Re: FirstSortedValue question</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633182#M232286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue(Date(TxnDate), Aggr(Min({&amp;lt;AccountType={'Income'}&amp;gt;TxnDate),CustomerListID, TxnDate))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2014 22:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue-question/m-p/633182#M232286</guid>
      <dc:creator />
      <dc:date>2014-05-29T22:47:42Z</dc:date>
    </item>
  </channel>
</rss>

