<?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: Min and aggr function are returning second lowest value when min value is zero in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462300#M484136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Henric and Gysbert for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was using a sum function also in the expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Min(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(sum({$&amp;lt;Field1=,Field2=&amp;gt;}&lt;SPAN style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM&gt;Price)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM&gt;Item_Code&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;))&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Here I am trying to find the minimum price of an item. This function along with isnull and rangemin function is used in axis limits of bubble chart which has a reference line. I am not getting correct minimum value if its zero hence few bubbles which will fall on zero x axis were not visible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Amit&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2013 09:08:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-06-13T09:08:44Z</dc:date>
    <item>
      <title>Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462297#M484132</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 trying to get the minimum value using the expression shown below:&lt;/P&gt;&lt;P&gt;Min&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Price&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Item_Code&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Minimum value obtained is correct when minimum value is non zero but if the minimum value is zero I am getting the lowest value greater than zero ie second lowest value.Is it possible to correct this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Amit&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:21:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462297#M484132</guid>
      <dc:creator />
      <dc:date>2013-06-11T19:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462298#M484134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't use the Aggr() function. You will most likely get the correct result if you use Min(Price) as expression and Item_Code as dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you really want the Aggr() function, you need to use an aggregation function as first parameter in the Aggr() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also: &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/03/11/when-should-the-aggr-function-not-be-used"&gt;When should the Aggr() function NOT be used?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:31:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462298#M484134</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-06-11T19:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462299#M484135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why are you using the aggr function? &lt;SPAN style="font-size: 10pt;"&gt;What that does it create a virtual table with Prices aggregated by Item_Code.You didn't specify an aggregation function to use inside the aggr so the only() funciton is used by default. f there are several prices for an Item_Code then only(Price) will return null since there are several possible Price values. That's likely why your 0 value isn't returned. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Check if the aggr is necessary. Try simply min(Price). If you do need the aggr then think hard about what kind of aggregation you need inside the aggr: min(aggr(avg(Price),Item_Code)... or max(Price)... or(sum(Price)... I have no idea. &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2013 19:35:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462299#M484135</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-06-11T19:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462300#M484136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Henric and Gysbert for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was using a sum function also in the expression:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Min(&lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(sum({$&amp;lt;Field1=,Field2=&amp;gt;}&lt;SPAN style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM&gt;Price)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;,&lt;SPAN style="color: #808080;"&gt;&lt;STRONG&gt;&lt;EM&gt;Item_Code&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;))&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Here I am trying to find the minimum price of an item. This function along with isnull and rangemin function is used in axis limits of bubble chart which has a reference line. I am not getting correct minimum value if its zero hence few bubbles which will fall on zero x axis were not visible.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thanks, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Amit&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 09:08:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462300#M484136</guid>
      <dc:creator />
      <dc:date>2013-06-13T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462301#M484137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is Item_Code a dimension in the chart? If so, you should just use Min(Price).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is not, you should put Min(Price) inside the Aggr(). Then you will get the minimum price per item. But, you need to determine what you want to show: Each bubble may perhaps represent &lt;EM&gt;&lt;STRONG&gt;several &lt;/STRONG&gt;&lt;/EM&gt;items, So, do you want the lowest Min(Price)? &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Min(Aggr(Min(Price),Item))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or do you want the average Min(Price)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Avg(Aggr(Min(Price),Item))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2013 10:02:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462301#M484137</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-06-13T10:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Min and aggr function are returning second lowest value when min value is zero</title>
      <link>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462302#M484138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Henric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;We were able to figure out the problem. The issue was the absence of datapoint for a certain combination. Hence we added zero as a datapoint for those combinations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 12:06:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Min-and-aggr-function-are-returning-second-lowest-value-when-min/m-p/462302#M484138</guid>
      <dc:creator />
      <dc:date>2013-06-21T12:06:30Z</dc:date>
    </item>
  </channel>
</rss>

