<?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: Calculate sales for previous year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730629#M261722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the above-funktion but it returns null for the first year, which is correct but I wan't to hide this row, is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="asdf.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62921_asdf.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2014 07:56:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-23T07:56:48Z</dc:date>
    <item>
      <title>Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730623#M261716</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;I wan't to use year as dimension and calculate the sales for the previous year. How do I do this if I wan't to view 4 years at the same time? Like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; width: 314px; height: 123px;" width="312"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Sales&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2014&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sales for 2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2013&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sales for 2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2012&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sales for 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2011&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sales for 2010&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do this in the easiest way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 06:55:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730623#M261716</guid>
      <dc:creator />
      <dc:date>2014-07-23T06:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730624#M261717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a date for sales for example sale_date then when you load your sales data add a field year(sale_date) as year, in this way simply doing a sum of sales values in the expression (using year as dimension) you will have whqat you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730624#M261717</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-07-23T07:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730625#M261718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its seems like rolling 4 years from current year. Work on the rolling years.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:08:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730625#M261718</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-07-23T07:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730626#M261719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have many ways to achieve that depending on your data model, you can prepare the previous sales in the script using the peek function on each year to peek the sales of the previous year.&lt;/P&gt;&lt;P&gt;you can do that from the chart using set analysis, where you will define a variable called vPreviousYear which is the selected year - 1 and use it when calculating the sales of this year, or if the years are sorted you can use the below function to get the sales of the below row for example the below sales for year 2014 will return the sales of 2013.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:14:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730626#M261719</guid>
      <dc:creator>maleksafa</dc:creator>
      <dc:date>2014-07-23T07:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730627#M261720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to showcase the data in table format , see the attachment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:17:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730627#M261720</guid>
      <dc:creator>PradeepReddy</dc:creator>
      <dc:date>2014-07-23T07:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730628#M261721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Easiest way of solve this problem would be i explain with an example see the inline table here i take 7 years sales data &lt;/P&gt;&lt;P&gt;and in the front end i take the straight table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year, Sales&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2014, 43432&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2013, 43244&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2012, 34556&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2011, 54545&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2010, 45365&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2009, 45356&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2008, 45653&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Straight table with dimension and expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dimension:- Year+1&lt;/P&gt;&lt;P&gt;Expression:- sum({&amp;lt;Year= { '&amp;gt;=$(=max(Year)-4)&amp;nbsp; &amp;lt;=$(=max(Year)-1) '}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note:- As you describe you need the data as and this chart is dynamic when you select 2012 year this will gives last 4 years data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;" width="312"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Year&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Sales&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2014&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Sales for 2013&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2013&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Sales for 2012&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2012&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Sales for 2011&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;2011&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;Sales for 2010&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then in the straight table you get data as mention above&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Roll4years.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62914_Roll4years.png" /&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730628#M261721</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-07-23T07:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730629#M261722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using the above-funktion but it returns null for the first year, which is correct but I wan't to hide this row, is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="asdf.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/62921_asdf.PNG.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 07:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730629#M261722</guid>
      <dc:creator />
      <dc:date>2014-07-23T07:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730630#M261723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check (in the presentation tab) the box "suppress zero values"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730630#M261723</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-07-23T08:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730631#M261724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried that, didn't help I'm afraid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:35:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730631#M261724</guid>
      <dc:creator />
      <dc:date>2014-07-23T08:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sales for previous year</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730632#M261725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you attach your document?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:39:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-sales-for-previous-year/m-p/730632#M261725</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-07-23T08:39:34Z</dc:date>
    </item>
  </channel>
</rss>

