<?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 Aggr function with ALL qualifier in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983419#M335672</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been asked to create a straight table chart showing all customers with total recurring revenue more than 100K grouped by father (I have predefined relationships between a father and its children).&lt;/P&gt;&lt;P&gt;So, I've created a calculated dimension using Aggr function and suppressed NULL values:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;While the expression in the table is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Attached, are QV and sample excel data files.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Now, I wanted to show the total number of customers in the table's title, so I've created the following expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;Count(If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID))&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Accordingly to the sample data there are 3 customers that match this criteria, but the expression resulted in 2 instead of 3!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Only after adding ALL qualifier it showed the right answer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;Count( &lt;STRONG&gt;ALL&lt;/STRONG&gt; If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID))&lt;/EM&gt;&lt;/SPAN&gt; &lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;I'm trying to understand WHY adding the qualifier solved the problem (because for now it is just a happy coincidence for me).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Any ideas that can shed some light on this would be much appreciated!&lt;/SPAN&gt;&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;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Anastasya&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Sep 2015 10:57:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-06T10:57:25Z</dc:date>
    <item>
      <title>Aggr function with ALL qualifier</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983419#M335672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been asked to create a straight table chart showing all customers with total recurring revenue more than 100K grouped by father (I have predefined relationships between a father and its children).&lt;/P&gt;&lt;P&gt;So, I've created a calculated dimension using Aggr function and suppressed NULL values:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;While the expression in the table is:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Attached, are QV and sample excel data files.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Now, I wanted to show the total number of customers in the table's title, so I've created the following expression:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;EM&gt;Count(If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID))&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Accordingly to the sample data there are 3 customers that match this criteria, but the expression resulted in 2 instead of 3!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Only after adding ALL qualifier it showed the right answer:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;Count( &lt;STRONG&gt;ALL&lt;/STRONG&gt; If(Aggr(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount),FatherID)&amp;gt;=100,FatherID))&lt;/EM&gt;&lt;/SPAN&gt; &lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;I'm trying to understand WHY adding the qualifier solved the problem (because for now it is just a happy coincidence for me).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Any ideas that can shed some light on this would be much appreciated!&lt;/SPAN&gt;&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;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Anastasya&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Sep 2015 10:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983419#M335672</guid>
      <dc:creator />
      <dc:date>2015-09-06T10:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with ALL qualifier</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983420#M335673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ALL qualifier is not recommended to use anymore as the combination of the Set Expression identifier 1 and the qualifier TOTAL taken together achieves the same as ALL. Qlik has deprecated the ALL qualifier meaning that you can still use it but it might disappear in the future - then all use of ALL has to be replaced by 1 and TOTAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum( {1} TOTAL Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is the same as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUM( ALL Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the TOTAL and 1 gives you more flexibility and also covering the ALL case. Furthermore when using ALL you can not use a Set Expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a snipping from the Help File of QlikView Desktop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In previous QlikView versions, the &lt;SPAN class="Bold"&gt;all&lt;/SPAN&gt; qualifier may occur before an &lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt;. This is equivalent to using &lt;SPAN class="Bold"&gt;{1} total&lt;/SPAN&gt;. In such a case the calculation will be made over all the values of the field in the document, disregarding the chart dimensions and current selections. (The same value is always returned regardless of the logical state in the document.) If the &lt;SPAN class="Bold"&gt;all&lt;/SPAN&gt; qualifier is used, a set expression cannot be used, since the all qualifier defines a set by itself. &lt;SPAN style="color: #ff0000;"&gt;For legacy reasons, the &lt;SPAN class="Bold"&gt;all&lt;/SPAN&gt; qualifier will still work in this QlikView version, but may be removed in coming versions&lt;/SPAN&gt;. &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Sep 2015 11:20:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983420#M335673</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-09-06T11:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with ALL qualifier</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983421#M335674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;this function will work &lt;/P&gt;&lt;P&gt;='Total: ' &amp;amp; Count({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;}Aggr(if(Sum({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;} Amount)&amp;gt;=100,only({&amp;lt;Year={"&amp;lt;=$(=GetFieldSelections(Year))"}&amp;gt;}FatherID)),FatherID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is that the FatherID 222 isn't in the selected data&lt;/P&gt;&lt;P&gt;this why i used the only function&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Sep 2015 11:31:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983421#M335674</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2015-09-06T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with ALL qualifier</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983422#M335675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for bringing this to my attention!&lt;/P&gt;&lt;P&gt;Your suggested solution works very good!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anastasya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2015 06:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983422#M335675</guid>
      <dc:creator />
      <dc:date>2015-09-07T06:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with ALL qualifier</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983423#M335676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liron,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;This works perfectly and I finally was able to understand why &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anastasya &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Sep 2015 06:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-function-with-ALL-qualifier/m-p/983423#M335676</guid>
      <dc:creator />
      <dc:date>2015-09-07T06:35:14Z</dc:date>
    </item>
  </channel>
</rss>

