<?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 with Year-1 Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325048#M498597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use set analysis in both Sums.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jun 2011 20:20:05 GMT</pubDate>
    <dc:creator>danielrozental</dc:creator>
    <dc:date>2011-06-27T20:20:05Z</dc:date>
    <item>
      <title>Using Aggr with Year-1 Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325047#M498596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; Hi,&amp;nbsp; I have the following expression that calculates a rate at various aggregated levels.&amp;nbsp; This works correctly, but I am having trouble creating the expression to perform the same calculation for year ago.&amp;nbsp; Here is the code that works correctly:&lt;/DIV&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;sum(aggr(Sum({$&amp;lt;[Department/No]=,Brand=,[Category/No]=,[Sub Category/No]=,[Product/No]=,UPC=,Segment=,[Sub Segment]=&amp;gt;}
&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; Total &amp;lt;[Store/No],Year&amp;gt; QTY_SHIP),Year,[Product/No],[Store/No])) &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;/&amp;nbsp; 
&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;sum(aggr(Sum({$&amp;lt;[Department/No]=,Brand=,[Category/No]=,[Sub Category/No]=,[Product/No]=,UPC=,Segment=,[Sub Segment]=&amp;gt;} 
&lt;/SPAN&gt;&lt;/DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; Total &amp;lt;Year&amp;gt; QTY_SHIP),Year,[Product/No]))&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/PRE&gt;&lt;DIV&gt;I have tried inserting the Year={$(=max(total Year)-1)} into the Set Analysis before &amp;amp; after the start of the aggr functions, but everything I have tried returns a null value.&amp;nbsp; Thanks for your input.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 19:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325047#M498596</guid>
      <dc:creator />
      <dc:date>2011-06-27T19:56:41Z</dc:date>
    </item>
    <item>
      <title>Using Aggr with Year-1 Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325048#M498597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to use set analysis in both Sums.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 20:20:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325048#M498597</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-06-27T20:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with Year-1 Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325049#M498598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; I did try this, and it is still returning null. &lt;/DIV&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;=sum( {$&amp;lt;[Year]={$(max(total Year)-1)}&amp;gt;}aggr(Sum({$&amp;lt;[Year]={$(max(total Year)-1)},[Department/No]=,Brand=,[Category/No]=,[Sub Category/No]=,[Product/No]=,UPC=,Segment=,[Sub Segment]=&amp;gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;Total &amp;lt;[Store/No],Year&amp;gt; QTY_SHIP),Year,[Product/No],[Store/No]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;/&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;sum({$&amp;lt;[Year]={$(max(total Year)-1)}&amp;gt;}aggr(Sum({$&amp;lt;[Year]={$(max(total Year)-1)},[Department/No]=,Brand=,[Category/No]=,[Sub Category/No]=,[Product/No]=,UPC=,Segment=,[Sub Segment]=&amp;gt;} &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp; Total &amp;lt;Year&amp;gt; QTY_SHIP),Year,[Product/No])) &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 20:30:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325049#M498598</guid>
      <dc:creator />
      <dc:date>2011-06-27T20:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Aggr with Year-1 Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325050#M498599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Start with a simple expression, make sure it's working fine and then build it up.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 20:34:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325050#M498599</guid>
      <dc:creator>danielrozental</dc:creator>
      <dc:date>2011-06-27T20:34:48Z</dc:date>
    </item>
    <item>
      <title>Using Aggr with Year-1 Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325051#M498600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sum( {$&amp;lt;[Year]={$(max(Year)-1)}&amp;gt;} QTY_SHIP) will tell you your total quantity shipped last year. Remove the '-1' to calculate current year: sum( {$&amp;lt;[Year]={$(max(Year))}&amp;gt;} QTY_SHIP). Divide one by the other to calculate your rate at whatever dimension level you need. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 21:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Aggr-with-Year-1-Set-Analysis/m-p/325051#M498600</guid>
      <dc:creator />
      <dc:date>2011-06-27T21:02:30Z</dc:date>
    </item>
  </channel>
</rss>

