<?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 syntax in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675578#M449741</link>
    <description>&lt;P&gt;Great, thanks for your help.&amp;nbsp; Still got zero, but you made me think that maybe it's hidden values.&amp;nbsp; So I did more googling and came up with :&lt;/P&gt;&lt;P&gt;min({&amp;lt;Qty={"&amp;gt;0"},Sales={"&amp;gt;0"}&amp;gt;} aggr(sum(Sales/Qty), [Order No], [Product])) and hey presto, I am getting the right answer.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Feb 2020 21:54:59 GMT</pubDate>
    <dc:creator>TomH</dc:creator>
    <dc:date>2020-02-13T21:54:59Z</dc:date>
    <item>
      <title>Firstsortedvalue syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675095#M449718</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;My usual goto resource for Qlik stuff is away, so apologies for the really simple question.&amp;nbsp; I've got a table below where I want to determine the average price for the each product, but also the minimum price.&amp;nbsp; The table below is only a sample as the actual data is '000 of lines long.&lt;/P&gt;&lt;P&gt;My price is sum(Sales)/Sum(Qty).&amp;nbsp; This works without issue, and aggregates the data under Product.&lt;/P&gt;&lt;P&gt;FirstSortedValue(distinct(Sales/Qty), SalesValue/Qty) should give me the minimum value, but it seems to be giving me 0, and I don't have any 0 values in my table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions would be great.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Orders.png" style="width: 304px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/28355iF65674315E839987/image-dimensions/304x146?v=v2" width="304" height="146" role="button" title="Orders.png" alt="Orders.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 00:31:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675095#M449718</guid>
      <dc:creator>TomH</dc:creator>
      <dc:date>2020-02-13T00:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675451#M449731</link>
      <description>&lt;P&gt;Hi Tom, firstsortedvalue will return the dimension text... take a look at help to understand: &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/BasicAggregationFunctions/firstsortedvalue.htm" target="_self"&gt;Help&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note that tables by default hides rows with value zero, so possibly there are combinatons with zero but they won't be shown on table.&lt;/P&gt;&lt;P&gt;Solution can be diffferent based on where you want to show the value, in example if you want it on a text object you can use:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;Min(&lt;/FONT&gt;&lt;FONT color="#99cc00"&gt;Aggr(&lt;/FONT&gt;sum(Sales)/Sum(Qty&lt;FONT color="#99cc00"&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;, [Order No], Product)&lt;/FONT&gt;&lt;FONT color="#ff0000"&gt;)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 16:44:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675451#M449731</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2020-02-13T16:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Firstsortedvalue syntax</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675578#M449741</link>
      <description>&lt;P&gt;Great, thanks for your help.&amp;nbsp; Still got zero, but you made me think that maybe it's hidden values.&amp;nbsp; So I did more googling and came up with :&lt;/P&gt;&lt;P&gt;min({&amp;lt;Qty={"&amp;gt;0"},Sales={"&amp;gt;0"}&amp;gt;} aggr(sum(Sales/Qty), [Order No], [Product])) and hey presto, I am getting the right answer.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 21:54:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-syntax/m-p/1675578#M449741</guid>
      <dc:creator>TomH</dc:creator>
      <dc:date>2020-02-13T21:54:59Z</dc:date>
    </item>
  </channel>
</rss>

