<?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 Using result of an Expression in Aggregate function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-result-of-an-Expression-in-Aggregate-function/m-p/1168104#M886194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use result of one of my expression in an aggregate function. But it says "bad field name". I know we cannot use them inside aggregate function. Is there any alternative to do this? Below is an Example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exp1: date(salesdate) - Label- Startdate&lt;/P&gt;&lt;P&gt;Exp2: Sum(if(salesdate&amp;gt;=&lt;SPAN style="font-size: 13.3333px;"&gt;Startdate and salesdate&amp;lt;=addmonths(&lt;SPAN style="font-size: 13.3333px;"&gt;Startdate,6),SalesQuantity,0))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator />
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Using result of an Expression in Aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-result-of-an-Expression-in-Aggregate-function/m-p/1168104#M886194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to use result of one of my expression in an aggregate function. But it says "bad field name". I know we cannot use them inside aggregate function. Is there any alternative to do this? Below is an Example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exp1: date(salesdate) - Label- Startdate&lt;/P&gt;&lt;P&gt;Exp2: Sum(if(salesdate&amp;gt;=&lt;SPAN style="font-size: 13.3333px;"&gt;Startdate and salesdate&amp;lt;=addmonths(&lt;SPAN style="font-size: 13.3333px;"&gt;Startdate,6),SalesQuantity,0))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-result-of-an-Expression-in-Aggregate-function/m-p/1168104#M886194</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Using result of an Expression in Aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Using-result-of-an-Expression-in-Aggregate-function/m-p/1168105#M886195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In this specific case,&lt;EM&gt; date(salesdate)&lt;/EM&gt; is just formatting the salesdate value to a date format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Exp2, you don't need a formatted date to make your numeric comparisons, so you could just write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(If(salesdate &amp;gt;= salesdate and salesdate &amp;lt;= addmonths(salesdate,6), SalesQuantity,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the date comparisions are always true, right?&lt;/P&gt;&lt;P&gt;So I guess that's not what you want (but it has nothing to do with expression referencing then, too).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Sep 2016 17:41:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-result-of-an-Expression-in-Aggregate-function/m-p/1168105#M886195</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-08T17:41:13Z</dc:date>
    </item>
  </channel>
</rss>

