<?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 Aggregate and exclude selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287904#M107114</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 have a problem with excluding the date selection from an aggregate function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1}aggr(if((Reg_Code = '3' or (Reg_Code = '2' and Type = '4') or Reg_Code = 4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Cancelled = '0', today() - Start_date),Reference_Number))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could someone assist, as far as I know, {1} should exclude the date selection and any other selection.&amp;nbsp; I've used it before but not combined with Aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 May 2011 14:38:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-10T14:38:44Z</dc:date>
    <item>
      <title>Aggregate and exclude selection</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287904#M107114</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 have a problem with excluding the date selection from an aggregate function.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1}aggr(if((Reg_Code = '3' or (Reg_Code = '2' and Type = '4') or Reg_Code = 4)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and Cancelled = '0', today() - Start_date),Reference_Number))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could someone assist, as far as I know, {1} should exclude the date selection and any other selection.&amp;nbsp; I've used it before but not combined with Aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shane&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 14:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287904#M107114</guid>
      <dc:creator />
      <dc:date>2011-05-10T14:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate and exclude selection</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287905#M107115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is correct that {1} will run your Sum over all data, eg disregarding all selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way you use Aggr() is not at all suitable as far as I can tell. If you look in the manual (press F1 in desktop client) you will find the definition as below. This means that in the most basic scenario you begin your aggr statement with an expression, followed by the dimensions over where the aggr should be calculated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;aggr ( &lt;SPAN style="font-style: italic;"&gt;[&lt;/SPAN&gt; distinct | nodistinct &lt;SPAN style="font-style: italic;"&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt; [{set_expression}]&lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;expression&lt;/SPAN&gt; {, &lt;SPAN style="font-style: italic;"&gt;dimension&lt;/SPAN&gt;} )&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your sample you setting the first part in the Aggr() could be Null, since your IF statement has no else clause. Not sure aggregating in this way on a null value will be successfull. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make further advising easier please attach a sample of your current app loaded with data, and a minimum set of objects. In case the data is sensitive, please scramble the fields to make them unreadable;&lt;/P&gt;&lt;P&gt;Settings &amp;gt; Document Settings &amp;gt; Scrambling&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 15:06:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287905#M107115</guid>
      <dc:creator>ToniKautto</dc:creator>
      <dc:date>2011-05-10T15:06:01Z</dc:date>
    </item>
    <item>
      <title>Aggregate and exclude selection</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287906#M107116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why don't you try with &lt;STRONG&gt;Total&lt;/STRONG&gt; instead of {1}.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 15:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregate-and-exclude-selection/m-p/287906#M107116</guid>
      <dc:creator />
      <dc:date>2011-05-10T15:09:23Z</dc:date>
    </item>
  </channel>
</rss>

