<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424961#M429334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many such discussions are there in community here. You have to just search: &lt;A href="https://community.qlik.com/thread/30532"&gt;FirstSortedValue()&lt;/A&gt;, or search help:&lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm"&gt;FirstSortedValue - chart function ‒ QlikView&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Aug 2017 10:14:36 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2017-08-18T10:14:36Z</dc:date>
    <item>
      <title>FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424960#M429333</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;Can some one give me a simple example of how to use firstsortedvalue in Qlikview script.&lt;/P&gt;&lt;P&gt;I want this function to come as a new column in the load statement of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:08:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424960#M429333</guid>
      <dc:creator>rahulsingh12</dc:creator>
      <dc:date>2017-08-18T10:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424961#M429334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many such discussions are there in community here. You have to just search: &lt;A href="https://community.qlik.com/thread/30532"&gt;FirstSortedValue()&lt;/A&gt;, or search help:&lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm"&gt;FirstSortedValue - chart function ‒ QlikView&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424961#M429334</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-18T10:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424962#M429335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, lets say you want to display supplier with highest sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Supplier, Sales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC-Company, 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC-Company, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ-Company, 4&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC-Company, 5&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ-Company, 8&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 123-Company, 15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this in text box as KPI:&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;=FirstSortedValue(Supplier,-aggr(sum(Sales),Supplier))&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1st parameter = what you want to display&lt;/LI&gt;&lt;LI&gt;2nd parameter = by which value you want it to sort (to sort from highest you must put minus sign in front)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result will be &lt;EM&gt;ABC-Company&lt;/EM&gt;, because its total sales is 20&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:16:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424962#M429335</guid>
      <dc:creator>masismykola</dc:creator>
      <dc:date>2017-08-18T10:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424963#M429336</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 am getting an error if I try to write in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:34:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424963#M429336</guid>
      <dc:creator>rahulsingh12</dc:creator>
      <dc:date>2017-08-18T10:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424964#M429337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can I write this at script level.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424964#M429337</guid>
      <dc:creator>rahulsingh12</dc:creator>
      <dc:date>2017-08-18T10:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424965#M429338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To write in script, one common fact to remember is - it's an aggregation function and probably missing a &lt;STRONG&gt;Group By&lt;/STRONG&gt; clause. Check: &lt;A href="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/AggregationFunctions/firstsorted.htm" title="http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/Scripting/AggregationFunctions/firstsorted.htm"&gt;FirstSortedValue - script function&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 10:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424965#M429338</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-18T10:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424966#M429339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sorry I didnt read carefully that evarything must&amp;nbsp; be in script. Here is example of using it in script:&lt;BR /&gt;You will get Products with smallest orders per Customer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD * inline [&lt;/P&gt;&lt;P&gt;Customer|Product|OrderNumber|UnitSales|CustomerID&lt;/P&gt;&lt;P&gt;Astrida|AA|1|10|1&lt;/P&gt;&lt;P&gt;Astrida|AA|7|18|1&lt;/P&gt;&lt;P&gt;Astrida|BB|4|9|1&lt;/P&gt;&lt;P&gt;Astrida|CC|6|2|1&lt;/P&gt;&lt;P&gt;Betacab|AA|5|4|2&lt;/P&gt;&lt;P&gt;Betacab|BB|2|5|2&lt;/P&gt;&lt;P&gt;Betacab|DD|12|25|2&lt;/P&gt;&lt;P&gt;Canutility|AA|3|8|3&lt;/P&gt;&lt;P&gt;Canutility|CC|13|19|3&lt;/P&gt;&lt;P&gt;Divadip|AA|9|16|4&lt;/P&gt;&lt;P&gt;Divadip|AA|10|16|4&lt;/P&gt;&lt;P&gt;Divadip|DD|11|10|4&lt;/P&gt;&lt;P&gt;] (delimiter is '|');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue:&lt;/P&gt;&lt;P&gt;LOAD Customer,FirstSortedValue(Product, UnitSales) as MyProductWithSmallestOrderByCustomer Resident Temp Group By Customer;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 11:04:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424966#M429339</guid>
      <dc:creator>masismykola</dc:creator>
      <dc:date>2017-08-18T11:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424967#M429340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Its working perfectly for ascending order of firstsortedvalue, but it showing blank for Divadip if i go for descending order. So i just changed the unit sales values to 17 in the example to work in both orders.&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;Temp:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD * inline [&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Customer|Product|OrderNumber|UnitSales|CustomerID&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Astrida|AA|1|10|1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Astrida|AA|7|18|1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Astrida|BB|4|9|1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Astrida|CC|6|2|1&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Betacab|AA|5|4|2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Betacab|BB|2|5|2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Betacab|DD|12|25|2&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Canutility|AA|3|8|3&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Canutility|CC|13|19|3&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Divadip|AA|9|16|4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Divadip|AA|10|17|4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Divadip|DD|11|10|4&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;] (delimiter is '|');&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;Ascending order &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Customer,FirstSortedValue(Product, UnitSales) as MyProductWithSmallestOrderByCustomer Resident Temp Group By Customer;&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;Descending order &lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;FirstSortedValue:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LOAD Customer,FirstSortedValue(Product, -UnitSales) as MyProductWithSmallestOrderByCustomer Resident Temp Group By Customer;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 15:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424967#M429340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-18T15:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: FirstSortedValue</title>
      <link>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424968#M429341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be add a DISTINCT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD * inline [&lt;/P&gt;&lt;P&gt;Customer|Product|OrderNumber|UnitSales|CustomerID&lt;/P&gt;&lt;P&gt;Astrida|AA|1|10|1&lt;/P&gt;&lt;P&gt;Astrida|AA|7|18|1&lt;/P&gt;&lt;P&gt;Astrida|BB|4|9|1&lt;/P&gt;&lt;P&gt;Astrida|CC|6|2|1&lt;/P&gt;&lt;P&gt;Betacab|AA|5|4|2&lt;/P&gt;&lt;P&gt;Betacab|BB|2|5|2&lt;/P&gt;&lt;P&gt;Betacab|DD|12|25|2&lt;/P&gt;&lt;P&gt;Canutility|AA|3|8|3&lt;/P&gt;&lt;P&gt;Canutility|CC|13|19|3&lt;/P&gt;&lt;P&gt;Divadip|AA|9|16|4&lt;/P&gt;&lt;P&gt;Divadip|AA|10|16|4&lt;/P&gt;&lt;P&gt;Divadip|DD|11|10|4&lt;/P&gt;&lt;P&gt;] (delimiter is '|');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue:&lt;/P&gt;&lt;P&gt;LOAD Customer,&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT Product, UnitSales) as MyProductWithSmallestOrderByCustomer,&lt;/P&gt;&lt;P&gt;'Asc' as Flag&lt;/P&gt;&lt;P&gt;Resident Temp Group By Customer;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FirstSortedValue:&lt;/P&gt;&lt;P&gt;LOAD Customer,&lt;/P&gt;&lt;P&gt;FirstSortedValue(DISTINCT Product, -UnitSales) as MyProductWithSmallestOrderByCustomer,&lt;/P&gt;&lt;P&gt;'Desc' as Flag&lt;/P&gt;&lt;P&gt;Resident Temp Group By Customer;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Aug 2017 16:38:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/FirstSortedValue/m-p/1424968#M429341</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-08-18T16:38:42Z</dc:date>
    </item>
  </channel>
</rss>

