<?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 SV:Aggr with If help needed in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183124#M48502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;if(aggr(sum(AnsMachine),JobNumber)=0, aggr(sum(Calls),JobNumber), 0)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Nov 2010 16:00:28 GMT</pubDate>
    <dc:creator>gandalfgray</dc:creator>
    <dc:date>2010-11-11T16:00:28Z</dc:date>
    <item>
      <title>Aggr with If help needed</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183122#M48500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to sum the number of calls in a job if the sum of the number of answer machines is 0. The formula that I have at the moment is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if(aggr(sum(AnsMachine),JobNumber)&amp;gt;0,0,aggr(sum(Calls),JobNumber)))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;but this is incorrect. The first point of this sums the answer machines, grouped by job, then checks if this is greater than 0 and if it is sets the result to 0, if the sum is 0 then is sums the calls over the same job numbers.&lt;/P&gt;&lt;P&gt;Any ideas where I am going wrong? I have attached a sample qvd which should help explain.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 15:37:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183122#M48500</guid>
      <dc:creator />
      <dc:date>2010-11-11T15:37:51Z</dc:date>
    </item>
    <item>
      <title>Aggr with If help needed</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183123#M48501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if(aggr(sum(AnsMachine),JobNumber)=0,aggr(sum(Calls),JobNumber),0))&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 15:54:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183123#M48501</guid>
      <dc:creator />
      <dc:date>2010-11-11T15:54:14Z</dc:date>
    </item>
    <item>
      <title>SV:Aggr with If help needed</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183124#M48502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or you can try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;if(aggr(sum(AnsMachine),JobNumber)=0, aggr(sum(Calls),JobNumber), 0)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 16:00:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183124#M48502</guid>
      <dc:creator>gandalfgray</dc:creator>
      <dc:date>2010-11-11T16:00:28Z</dc:date>
    </item>
    <item>
      <title>SV:Aggr with If help needed</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183125#M48503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found that performance takes a hit the more IF statements you have within the sum. However, Sum (if x=y,y) seems to run better than if(x=y,sum(y)). They don't work exacly the same way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 16:21:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183125#M48503</guid>
      <dc:creator />
      <dc:date>2010-11-11T16:21:26Z</dc:date>
    </item>
    <item>
      <title>Aggr with If help needed</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183126#M48504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Thanks for the help. Although not exactly what I wanted I waas able to use the different suggestions to get to the answer (although I'm not totally sure why it is the answer. The final solution is below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(if(aggr(sum(AnsMachine),JobNumber)=0,aggr(sum(Calls),JobNumber),aggr(sum(AnsMachine*0.1)+sum(Calls),JobNumber)),JobNumber))&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You may notice that it is a little more complicated than the original, where the sum of answer machines is 0 I want one formula, where it is not 0 I want another.&lt;/P&gt;&lt;P&gt;Thanks for you help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Nov 2010 17:13:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-with-If-help-needed/m-p/183126#M48504</guid>
      <dc:creator />
      <dc:date>2010-11-11T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

