<?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 Why Is this Function not Working? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-Is-this-Function-not-Working/m-p/143932#M23021</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an aggregation function and I am having problems in some cases.&lt;/P&gt;&lt;P&gt;The syntax that is not working is these:&lt;/P&gt;&lt;P&gt;sum(aggr(only(OpenValue),Document,DueDate)&lt;/P&gt;&lt;P&gt;+if(PaymentDate&amp;gt;AsOfDate,PayedValue,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I take out the aggregation function gives the correct number:&lt;/P&gt;&lt;P&gt;sum(if(PaymentDate&amp;gt;AsOfDate,PayedValue,0))&lt;/P&gt;&lt;P&gt;Why the aggreation function is changing my results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 02:05:08 GMT</pubDate>
    <dc:creator>rcandeo</dc:creator>
    <dc:date>2009-05-13T02:05:08Z</dc:date>
    <item>
      <title>Why Is this Function not Working?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-Is-this-Function-not-Working/m-p/143932#M23021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using an aggregation function and I am having problems in some cases.&lt;/P&gt;&lt;P&gt;The syntax that is not working is these:&lt;/P&gt;&lt;P&gt;sum(aggr(only(OpenValue),Document,DueDate)&lt;/P&gt;&lt;P&gt;+if(PaymentDate&amp;gt;AsOfDate,PayedValue,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I take out the aggregation function gives the correct number:&lt;/P&gt;&lt;P&gt;sum(if(PaymentDate&amp;gt;AsOfDate,PayedValue,0))&lt;/P&gt;&lt;P&gt;Why the aggreation function is changing my results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 02:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-Is-this-Function-not-Working/m-p/143932#M23021</guid>
      <dc:creator>rcandeo</dc:creator>
      <dc:date>2009-05-13T02:05:08Z</dc:date>
    </item>
    <item>
      <title>Why Is this Function not Working?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-Is-this-Function-not-Working/m-p/143933#M23022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can add an aggregation to an if statement. An aggregation returns a list of rows. The IF statement returns a single value. You can't add a single value to a list of rows.&lt;/P&gt;&lt;P&gt;I have no idea what you're actually trying to accomplish, but my guess is that you either need to move the IF inside the aggregation, or move the + outside of the sum.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 07:49:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-Is-this-Function-not-Working/m-p/143933#M23022</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-05-13T07:49:52Z</dc:date>
    </item>
  </channel>
</rss>

