<?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 Issues with Aggr function with dates and targets in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488779#M1139878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 expressions called A and B, both of which are trying to count the number of days an agent worked and multiplies it by a target value unique to them. Neither of which are doing it correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following formulas to try and calculate this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression A:&lt;/P&gt;&lt;P&gt;Sum(Aggr(Count(DISTINCT CallDate &amp;amp; Agent) * [Total Target],Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression B:&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}Distinct CallDate &amp;amp; Agent) * &lt;/P&gt;&lt;P&gt;(Sum({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}[Total Target]) / COUNT({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}DISTINCT Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression A gives me the correct total, however, when viewed in a table against Dimension 'CallDate', it seems to show the outcome of the expression against random Calldates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression B gives me the correct values by dimension but the total is incorrect and changes when the dimesion is cyclic (CallDate - Week - Month).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attach the file so you can see what i mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Sep 2013 14:13:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-05T14:13:01Z</dc:date>
    <item>
      <title>Issues with Aggr function with dates and targets</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488779#M1139878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 expressions called A and B, both of which are trying to count the number of days an agent worked and multiplies it by a target value unique to them. Neither of which are doing it correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following formulas to try and calculate this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression A:&lt;/P&gt;&lt;P&gt;Sum(Aggr(Count(DISTINCT CallDate &amp;amp; Agent) * [Total Target],Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression B:&lt;/P&gt;&lt;P&gt;COUNT({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}Distinct CallDate &amp;amp; Agent) * &lt;/P&gt;&lt;P&gt;(Sum({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}[Total Target]) / COUNT({$&amp;lt;[Cam/Acc] = {'Account'}&amp;gt;}DISTINCT Agent))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression A gives me the correct total, however, when viewed in a table against Dimension 'CallDate', it seems to show the outcome of the expression against random Calldates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression B gives me the correct values by dimension but the total is incorrect and changes when the dimesion is cyclic (CallDate - Week - Month).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attach the file so you can see what i mean.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 14:13:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488779#M1139878</guid>
      <dc:creator />
      <dc:date>2013-09-05T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Aggr function with dates and targets</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488780#M1139879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum(aggr(sum([Total Target]),CallDate)) maybe?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Sep 2013 16:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488780#M1139879</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-05T16:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Aggr function with dates and targets</title>
      <link>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488781#M1139880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks G Wassenaar!,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spot on!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Sep 2013 08:06:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Issues-with-Aggr-function-with-dates-and-targets/m-p/488781#M1139880</guid>
      <dc:creator />
      <dc:date>2013-09-06T08:06:38Z</dc:date>
    </item>
  </channel>
</rss>

