<?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 How to calculate the previous year data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322796#M118901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The formula: sum({&amp;lt;Year = {"$(=Max(Year)-1"}&amp;gt;}Amount) uses a set expression. In the QV manual there is a part about set analysis en set expressions, I advise you to read that part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jun 2011 08:49:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-27T08:49:33Z</dc:date>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322791#M118896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load * Inline&lt;BR /&gt;[&lt;BR /&gt;Year,Month,Amount,Region&lt;BR /&gt;2010,1,3000,Brazil&lt;BR /&gt;2011,1,5000,Brazil&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to get the previous year data based on the current year, I use pivot table to achieve;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Dimension is Region, and I put two Measures into the pivot: sum(if(Year='2011',Amount)) , sum(if(Year='2010',Amount)).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I also put Year as a parameter, when I select 2011, the 2010's data is zero, so how to calculate the previous year data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 07:38:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322791#M118896</guid>
      <dc:creator />
      <dc:date>2011-06-27T07:38:06Z</dc:date>
    </item>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322792#M118897</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;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum({&amp;lt;Year = {"$(=Max(Year)-1"}&amp;gt;}Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:03:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322792#M118897</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-06-27T08:03:11Z</dc:date>
    </item>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322793#M118898</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;Now I have another question, based on my understanding, the selection should filter the data, for example: if I choose 2011 on Year, the dataset just includes 2011's data not 2010. So the expression sum(if(Year='2010',Amount))&amp;nbsp; always shows zero, but why sum({&amp;lt;Year = {"$(=Max(Year)-1"}&amp;gt;}Amount) does not show zero?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:27:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322793#M118898</guid>
      <dc:creator />
      <dc:date>2011-06-27T08:27:32Z</dc:date>
    </item>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322794#M118899</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;&amp;nbsp;&amp;nbsp;&amp;nbsp; The expression i gave you will give you previous years data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Means if you select the 2011, it will give value for 2010.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:33:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322794#M118899</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-06-27T08:33:00Z</dc:date>
    </item>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322795#M118900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but I was wondering why&amp;nbsp; sum(if(Year='2010',Amount))&amp;nbsp; shows zero?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322795#M118900</guid>
      <dc:creator />
      <dc:date>2011-06-27T08:45:19Z</dc:date>
    </item>
    <item>
      <title>How to calculate the previous year data</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322796#M118901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The formula: sum({&amp;lt;Year = {"$(=Max(Year)-1"}&amp;gt;}Amount) uses a set expression. In the QV manual there is a part about set analysis en set expressions, I advise you to read that part.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jun 2011 08:49:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-the-previous-year-data/m-p/322796#M118901</guid>
      <dc:creator />
      <dc:date>2011-06-27T08:49:33Z</dc:date>
    </item>
  </channel>
</rss>

