<?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: Aggregating prior year data in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653504#M238843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brilliant solutions! I got it to work "partially". The problem I have now is when I use the expression below to restrict the result to only a certain kind of customers, it does not add up correctly all the time. It returns 0 for the accumulative number, if the current year's sale_amt is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(rangesum(above(total sum({&amp;lt;Customer.Status={'New'}, Customer.Year=&amp;gt;}Customer.Sale_Amt),0,2)),Customer.Year))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Jul 2014 19:29:55 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-12T19:29:55Z</dc:date>
    <item>
      <title>Aggregating prior year data in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653501#M238840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qlik Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a set of sales data that I'd like to make year-over-year comparisons. The table I'm trying to create needs to include both current year (CY) and prior year (PY) data on the same row, while using year as the dimension. Having both year's data on the same line helps in calculating differences over years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To illustrate, it looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Year&amp;nbsp;&amp;nbsp; CY_Sales PY_Sales&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp; $200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $210&lt;/P&gt;&lt;P&gt;2013&amp;nbsp;&amp;nbsp; $210&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $180&lt;/P&gt;&lt;P&gt;2012&amp;nbsp;&amp;nbsp; $180&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $170&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data includes sales information from 2011-2014, but only 2012-2014 should be shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried using various set analysis expressions. None of them seem to work.&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Year = {$(=nYear-1)}&amp;gt; TOTAL Sales})&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Year = {'=Max(Year)-1'}&amp;gt; Sales})&lt;/P&gt;&lt;P&gt;or simply making column PY_Sales = below(CY_Sales), but since 2011 data is not included in the chart, PY_Sales for 2012 is 0, there is also problem when a user makes a selection, and only a single year's data is returned. So this option is not feasible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas for solving this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jul 2014 15:03:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653501#M238840</guid>
      <dc:creator />
      <dc:date>2014-07-10T15:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating prior year data in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653502#M238841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The table I'm trying to create needs to include both current year (CY) and prior year (PY) data on the same row, while using year as the dimension&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In that case you cannot use set analysis (well, not easily). Set analysis creates one set per chart, not per row. But there are other solutions. See this document: &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4252" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7; text-decoration: underline;"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jul 2014 10:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653502#M238841</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-07-11T10:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating prior year data in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653503#M238842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for replying! I will look into the solution you mentioned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2014 04:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653503#M238842</guid>
      <dc:creator />
      <dc:date>2014-07-12T04:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating prior year data in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653504#M238843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Brilliant solutions! I got it to work "partially". The problem I have now is when I use the expression below to restrict the result to only a certain kind of customers, it does not add up correctly all the time. It returns 0 for the accumulative number, if the current year's sale_amt is 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(rangesum(above(total sum({&amp;lt;Customer.Status={'New'}, Customer.Year=&amp;gt;}Customer.Sale_Amt),0,2)),Customer.Year))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Jul 2014 19:29:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-prior-year-data-in-set-analysis/m-p/653504#M238843</guid>
      <dc:creator />
      <dc:date>2014-07-12T19:29:55Z</dc:date>
    </item>
  </channel>
</rss>

