<?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 Re: Reference another subset within aggregate function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598817#M1094617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This response was helpful to me as a newbie, but it did not solve the stated problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 May 2014 18:32:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-09T18:32:50Z</dc:date>
    <item>
      <title>Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598814#M1094614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have what might seem to be a rather simple requirement, but being new to QV, have yet to find any good examples or clear documentation suggesting that QV can in fact do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given the following set (13 months in descending order from May 2014 to May 2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year, Month, Affiliate, CustomerType, OrderQuantity&lt;/P&gt;&lt;P&gt;2014, 5, US, Partner, 10&lt;/P&gt;&lt;P&gt;2014, 4, US, Partner, 9&lt;/P&gt;&lt;P&gt;2014, 3, US, Partner, 8&lt;/P&gt;&lt;P&gt;2014, 2, US, Partner, 7&lt;/P&gt;&lt;P&gt;2014, 1, US, Partner, 7&lt;/P&gt;&lt;P&gt;2013, 12, US, Partner, 7&lt;/P&gt;&lt;P&gt;2013, 11, US, Partner, 6&lt;/P&gt;&lt;P&gt;2013, 10, US, Partner, 9&lt;/P&gt;&lt;P&gt;2013, 9, US, Partner, 6&lt;/P&gt;&lt;P&gt;2013, 8, US, Partner, 5&lt;/P&gt;&lt;P&gt;2013, 7, US, Partner, 6&lt;/P&gt;&lt;P&gt;2013, 6, US, Partner, 5&lt;/P&gt;&lt;P&gt;2013, 5, US, Partner, 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Display a pivot table with the following summary when the user selects/filters on the May 2014 record:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Period, Affiliate, CustomerType, OrderQuantity, OrderQuantityLastYear, %Change, YTD&lt;/P&gt;&lt;P&gt;May 2014, US, Partner, 10, 3, 333%, 41&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on what I've read, to get the OrderQuantityLastYear, column, one would enter a set analysis expression like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Year={$(=Year-1)}, Month={$(=Month)}, ...&amp;gt;} OrderQuantity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or even like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Year={2013}, Month={5}, ...&amp;gt;} OrderQuantity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where ... are the remaining columns that should be equal to the current record. But this does not have the effect of summarizing records with year 2013, month 5, and appending the result to the current record in a new column -- the output is always just 0. Am I doing something wrong here, or is this just not possible? Is seems so simple...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any advice is much appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 22:39:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598814#M1094614</guid>
      <dc:creator />
      <dc:date>2014-05-05T22:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598815#M1094615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using dimensions Year and Month, the current dimension value is incompatible with your set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use TOTAL qualifier to make it compatible, then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Sum (TOTAL {&amp;lt;Year={2013}, Month={5}, ...&amp;gt;} OrderQuantity)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 22:44:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598815#M1094615</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-05T22:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598816#M1094616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So two requirements of this type of report would seem to be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The ability to perform mathematical operations within a set expression. As none of the examples in the documentation show this, it may simply be unsupported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. The ability to reference the "current" record on the right-hand-side of an expression. The examples in the documentation that reference a dimension on the RHS, are referencing the entire set of values for that dimension, not the "current" value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As it seems these things are not supported, I've moved the work done here to the database engine, however that has the undesirable qualities of being both inflexible (the user cannot easily change the report) and self-joins required to implement this in SQL can be taxing on the query engine. Any gurus out there able to show that these two capabilities are in fact supported in QV?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 18:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598816#M1094616</guid>
      <dc:creator />
      <dc:date>2014-05-09T18:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598817#M1094617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This response was helpful to me as a newbie, but it did not solve the stated problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 18:32:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598817#M1094617</guid>
      <dc:creator />
      <dc:date>2014-05-09T18:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598818#M1094618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry if this haven't solved your issue, I think I haven't fully understood your points 1 and 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about attached sample?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 18:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598818#M1094618</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-09T18:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598819#M1094619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry swuehl, I am running Personal Edition and am not able to open the attachment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 12:41:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598819#M1094619</guid>
      <dc:creator />
      <dc:date>2014-05-12T12:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reference another subset within aggregate function</title>
      <link>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598820#M1094620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the data from your original post, then created a straight table with dimensions Year, Month, Affiliate, Customer Type and some expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(OrderQuantity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum (TOTAL {&amp;lt;Year={$(=max(Year)-1)}, Month={$(=max(Month))} &amp;gt;} OrderQuantity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=column(1)/column(2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Month=&amp;gt;}TOTAL OrderQuantity)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and selected Year = 2014 and Month = 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to demo some thoughts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 20:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Reference-another-subset-within-aggregate-function/m-p/598820#M1094620</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-12T20:30:41Z</dc:date>
    </item>
  </channel>
</rss>

