<?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 Aggr function inside Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Aggr-function-inside-Set-analysis/m-p/692701#M1062326</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm Using below aggr function to calculate sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(Aggr(&lt;/P&gt;&lt;P&gt;money((if(OWNER='ABC',0,&lt;/P&gt;&lt;P&gt;(if(((OWNER='EFG' or OWNER='HIJ') and (Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')))&lt;/P&gt;&lt;P&gt;,sum(EFG_Total),(if((OWNER='EFG'),sum(EFG_Total),(if((Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')),&lt;/P&gt;&lt;P&gt;((if((sum(COUNT)&amp;lt;=3000),((sum(COUNT)*.1)*9.6),if((sum(COUNT)&amp;gt;3000 and&amp;nbsp; sum(COUNT)&amp;lt;=4000),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-3000)*.083)+158)*9.6),((((sum(COUNT)-4000)*.071)+5897)*9.6))))) ,&lt;/P&gt;&lt;P&gt;((if((sum(COUNT)&amp;lt;=3000),((sum(COUNT)*.101)*9.6),if((sum(COUNT)&amp;gt;3000 and&amp;nbsp; sum(COUNT)&amp;lt;=4000),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-3000)*.0897)+848)*9.6),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-4000)*.0487)+1646)*9.6)))))))))))))), OWNER,MonthYear))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to compare sums of two years (current year (selected year) and previous year. So i can use set analysis to compare it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(=Max(Year)-1)}&amp;gt;}Value)&amp;nbsp;&amp;nbsp;&amp;nbsp; and &lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(=Max(Year))}&amp;gt;}Value) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i can't use Aggr here because if i select year it only display selected year since i use year inside my aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 10:14:16 GMT</pubDate>
    <dc:creator>anuradhaa</dc:creator>
    <dc:date>2014-09-25T10:14:16Z</dc:date>
    <item>
      <title>Using Aggr function inside Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-function-inside-Set-analysis/m-p/692701#M1062326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm Using below aggr function to calculate sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum(Aggr(&lt;/P&gt;&lt;P&gt;money((if(OWNER='ABC',0,&lt;/P&gt;&lt;P&gt;(if(((OWNER='EFG' or OWNER='HIJ') and (Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')))&lt;/P&gt;&lt;P&gt;,sum(EFG_Total),(if((OWNER='EFG'),sum(EFG_Total),(if((Date#(MonthYear,'MMM-YY') &amp;lt;= date#('Jun-14','MMM-YY')),&lt;/P&gt;&lt;P&gt;((if((sum(COUNT)&amp;lt;=3000),((sum(COUNT)*.1)*9.6),if((sum(COUNT)&amp;gt;3000 and&amp;nbsp; sum(COUNT)&amp;lt;=4000),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-3000)*.083)+158)*9.6),((((sum(COUNT)-4000)*.071)+5897)*9.6))))) ,&lt;/P&gt;&lt;P&gt;((if((sum(COUNT)&amp;lt;=3000),((sum(COUNT)*.101)*9.6),if((sum(COUNT)&amp;gt;3000 and&amp;nbsp; sum(COUNT)&amp;lt;=4000),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-3000)*.0897)+848)*9.6),&lt;/P&gt;&lt;P&gt;((((sum(COUNT)-4000)*.0487)+1646)*9.6)))))))))))))), OWNER,MonthYear))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i want to compare sums of two years (current year (selected year) and previous year. So i can use set analysis to compare it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(=Max(Year)-1)}&amp;gt;}Value)&amp;nbsp;&amp;nbsp;&amp;nbsp; and &lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(=Max(Year))}&amp;gt;}Value) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i can't use Aggr here because if i select year it only display selected year since i use year inside my aggr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 10:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-function-inside-Set-analysis/m-p/692701#M1062326</guid>
      <dc:creator>anuradhaa</dc:creator>
      <dc:date>2014-09-25T10:14:16Z</dc:date>
    </item>
  </channel>
</rss>

