<?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 Advanced Aggr Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-Function/m-p/362013#M134573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to solve for the code below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear))}&amp;gt;} [Spend]))&lt;/SPAN&gt; /&lt;/P&gt;&lt;P&gt;sum(aggr(sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear)-1)}&amp;gt;} [Spend])) /&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear)-1)},CalendarQuarter=,CalendarMonth=&amp;gt;} Qty)) *&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear))}&amp;gt;} if(len(Subcategory)&amp;gt;0,Qty)), Material))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On top of this I want to add the below condition for spend in the numerator (highlighted in red):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate spend in current year only when Material exists in "max(CalendarYear)-1" so I wanted to use an aggr function in Numerator?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prakash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Apr 2012 20:29:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-20T20:29:55Z</dc:date>
    <item>
      <title>Advanced Aggr Function</title>
      <link>https://community.qlik.com/t5/QlikView/Advanced-Aggr-Function/m-p/362013#M134573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to solve for the code below &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear))}&amp;gt;} [Spend]))&lt;/SPAN&gt; /&lt;/P&gt;&lt;P&gt;sum(aggr(sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear)-1)}&amp;gt;} [Spend])) /&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear)-1)},CalendarQuarter=,CalendarMonth=&amp;gt;} Qty)) *&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;CalendarYear = {$(#=max(CalendarYear))}&amp;gt;} if(len(Subcategory)&amp;gt;0,Qty)), Material))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On top of this I want to add the below condition for spend in the numerator (highlighted in red):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate spend in current year only when Material exists in "max(CalendarYear)-1" so I wanted to use an aggr function in Numerator?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prakash&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Apr 2012 20:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Advanced-Aggr-Function/m-p/362013#M134573</guid>
      <dc:creator />
      <dc:date>2012-04-20T20:29:55Z</dc:date>
    </item>
  </channel>
</rss>

