<?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 Help with SUM( ) function required - possibly need AGGR? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-SUM-function-required-possibly-need-AGGR/m-p/260959#M1204873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;I have a table containing a set of targets, by Sector for a set of measures, each one relating to a particular month&lt;/P&gt;&lt;P&gt;In a seperate table I have a set of sales figures, which are measured against the targets.&lt;/P&gt;&lt;P&gt;Each month, multiple sales for each sector are measured each target.&lt;/P&gt;&lt;P&gt;My target table contains the following fields&lt;/P&gt;&lt;P&gt;Sector TargetMonth TargetValue&lt;/P&gt;&lt;P&gt;UK Apr-10 10&lt;/P&gt;&lt;P&gt;India Apr-10 15&lt;/P&gt;&lt;P&gt;UK May-10 20&lt;/P&gt;&lt;P&gt;... ...&lt;/P&gt;&lt;P&gt;In a straight table I am trying to add up the targets for each sector for the year to date, using the following formula&lt;/P&gt;&lt;P&gt;SUM (IF(TargetMonth &amp;gt;= 'Apr 10' AND TargetMonth &amp;lt;= 'May-10', TargetValue))&lt;/P&gt;&lt;P&gt;However, the fugure i get back is far too high, i think this is because it is adding a TargetValue for each sale linked to a particular target.&lt;/P&gt;&lt;P&gt;How can i make it only include a particular target once across the date range?&lt;/P&gt;&lt;P&gt;Strangely when i do it for a single month it's fine! e.g. SUM (IF(TargetMonth = 'Apr 10' , TargetValue))&lt;/P&gt;&lt;P&gt;Any help of advice is greatly appreciated.&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Jun 2010 22:52:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-04T22:52:09Z</dc:date>
    <item>
      <title>Help with SUM( ) function required - possibly need AGGR?</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-SUM-function-required-possibly-need-AGGR/m-p/260959#M1204873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Hope you can help.&lt;/P&gt;&lt;P&gt;I have a table containing a set of targets, by Sector for a set of measures, each one relating to a particular month&lt;/P&gt;&lt;P&gt;In a seperate table I have a set of sales figures, which are measured against the targets.&lt;/P&gt;&lt;P&gt;Each month, multiple sales for each sector are measured each target.&lt;/P&gt;&lt;P&gt;My target table contains the following fields&lt;/P&gt;&lt;P&gt;Sector TargetMonth TargetValue&lt;/P&gt;&lt;P&gt;UK Apr-10 10&lt;/P&gt;&lt;P&gt;India Apr-10 15&lt;/P&gt;&lt;P&gt;UK May-10 20&lt;/P&gt;&lt;P&gt;... ...&lt;/P&gt;&lt;P&gt;In a straight table I am trying to add up the targets for each sector for the year to date, using the following formula&lt;/P&gt;&lt;P&gt;SUM (IF(TargetMonth &amp;gt;= 'Apr 10' AND TargetMonth &amp;lt;= 'May-10', TargetValue))&lt;/P&gt;&lt;P&gt;However, the fugure i get back is far too high, i think this is because it is adding a TargetValue for each sale linked to a particular target.&lt;/P&gt;&lt;P&gt;How can i make it only include a particular target once across the date range?&lt;/P&gt;&lt;P&gt;Strangely when i do it for a single month it's fine! e.g. SUM (IF(TargetMonth = 'Apr 10' , TargetValue))&lt;/P&gt;&lt;P&gt;Any help of advice is greatly appreciated.&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;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jun 2010 22:52:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-SUM-function-required-possibly-need-AGGR/m-p/260959#M1204873</guid>
      <dc:creator />
      <dc:date>2010-06-04T22:52:09Z</dc:date>
    </item>
    <item>
      <title>Help with SUM( ) function required - possibly need AGGR?</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-SUM-function-required-possibly-need-AGGR/m-p/260960#M1204874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not calculate the sum in the script and then use it as a dimension (its more efficient)?&lt;/P&gt;&lt;P&gt;Load sector,&lt;/P&gt;&lt;P&gt;sum(TargetValue) as TotTargetValue&lt;/P&gt;&lt;P&gt;group by sector&lt;/P&gt;&lt;P&gt;from targetstable&lt;/P&gt;&lt;P&gt;where TargetMonth&amp;gt;= startmonth&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Gordon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Jun 2010 17:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-SUM-function-required-possibly-need-AGGR/m-p/260960#M1204874</guid>
      <dc:creator />
      <dc:date>2010-06-05T17:59:11Z</dc:date>
    </item>
  </channel>
</rss>

