<?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: Sales on Year minus Sales on Previous Year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891890#M1008155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matthieu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please don't forget about set analysis mechanism which is far stronger then inter-record functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this you can state:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={2000}&lt;/SPAN&gt;&amp;gt;} Value) = Sum({&amp;lt;Year={2001}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define variables vCurrYear and vPrevYear and then use them:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={$(vCurrYear)}&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;gt;} Value) = Sum({&amp;lt;Year={&lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vPrevYear)&lt;/SPAN&gt;}&amp;gt;} Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's event possible to fold all set analysis expression into variable - &lt;SPAN style="font-size: 13.3333330154419px;"&gt;vCurrYear = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={$(vCurrYearNum)}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(not sure the syntaxis is correct everywhere, but the idea is clear I hope)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Maxim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 May 2015 04:06:38 GMT</pubDate>
    <dc:creator>maksim_senin</dc:creator>
    <dc:date>2015-05-08T04:06:38Z</dc:date>
    <item>
      <title>Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891887#M1008152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I've been looking for an answer for quite a while, without success.&lt;BR /&gt;Here's the problem:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I need to create a chart where there'll be something like this&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Year&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Growth&lt;/P&gt;&lt;P&gt;2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N/A&lt;/P&gt;&lt;P&gt;2001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30&lt;BR /&gt;2002&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -20&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;2003&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 20&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't pay to much attention on the values, it's just an example.&lt;BR /&gt;I actually need to compare values of a same Element on two different dates&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd write it like this:&amp;nbsp;&amp;nbsp; sum(SALES[YEAR]) - sum(SALES[YEAR-1])&lt;BR /&gt;but apparently, it doesn't work that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried by creating variables like vYear = YEAR and vPrevYear = YEAR - 1&lt;BR /&gt;But nothing works &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2015 23:07:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891887#M1008152</guid>
      <dc:creator />
      <dc:date>2015-05-06T23:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891888#M1008153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try sum(Value) - sum(above(Value).&lt;/P&gt;&lt;P&gt;Or read this document: &lt;A _jive_internal="true" href="https://community.qlik.com/docs/DOC-4252" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&gt;Calculating rolling n-period totals, averages or other aggregations&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 09:47:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891888#M1008153</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-07T09:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891889#M1008154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, it worked quite well for one of them, also used the below() for another one, but I still have an issue for where they're not right above/underneath each other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the picture, the last blocks (the ones with 0) need to show the growth for each type of object year to year.&lt;BR /&gt;So the above works well when nothing is expanded, as years appear right above each others, but when I expand the objects fields, it's not working anymore &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="qlikviewproblem.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/85985_qlikviewproblem.png" style="height: 157px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 23:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891889#M1008154</guid>
      <dc:creator />
      <dc:date>2015-05-07T23:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891890#M1008155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matthieu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please don't forget about set analysis mechanism which is far stronger then inter-record functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With this you can state:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={2000}&lt;/SPAN&gt;&amp;gt;} Value) = Sum({&amp;lt;Year={2001}&amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define variables vCurrYear and vPrevYear and then use them:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Sum({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={$(vCurrYear)}&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&amp;gt;} Value) = Sum({&amp;lt;Year={&lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vPrevYear)&lt;/SPAN&gt;}&amp;gt;} Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's event possible to fold all set analysis expression into variable - &lt;SPAN style="font-size: 13.3333330154419px;"&gt;vCurrYear = &lt;SPAN style="font-size: 13.3333330154419px;"&gt;Year={$(vCurrYearNum)}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(not sure the syntaxis is correct everywhere, but the idea is clear I hope)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Maxim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 04:06:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891890#M1008155</guid>
      <dc:creator>maksim_senin</dc:creator>
      <dc:date>2015-05-08T04:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891891#M1008156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The inter-record functions like above, below, before etc.. by default don't cross dimension borders. By adding the TOTAL qualifier they will cross dimension borders. Unfortunately it's a all or nothing, either none or ignore all dimension borders. In case of your pivot table you could try pivoting your year dimension to horizontal layout by dragging its header to the right above the expressions. There'll be only the year dimension horizontally so &lt;EM&gt;sum(value) - before(sum(value))&lt;/EM&gt; should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that's not a workable solution you can try the AsOf solution described in the document &lt;A _jive_internal="true" data-containerid="2049" data-containertype="14" data-objectid="4252" data-objecttype="102" href="https://community.qlik.com/docs/DOC-4252" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&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, 08 May 2015 07:31:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891891#M1008156</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-08T07:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891892#M1008157</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;PFA the attached application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Ankita&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 07:56:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891892#M1008157</guid>
      <dc:creator>ankitaag</dc:creator>
      <dc:date>2015-05-08T07:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sales on Year minus Sales on Previous Year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891893#M1008158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for all the answers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get to something like this &lt;/P&gt;&lt;P&gt;Sum({&amp;lt;CALENDAR_YEAR={$(vYear)}&amp;gt;} AMOUNT_SOLD/PROD_LIST_PRICE) -&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;CALENDAR_YEAR={$(vPreviousYear)}&amp;gt;} AMOUNT_SOLD/PROD_LIST_PRICE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(with vYear = CALENDAR_YEAR and vPreviousYear = CALENDAR_YEAR-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't gets me what I need, here's what comes when I only select the 1999 year:&lt;BR /&gt;(Somme des quantitées vendues works with this expression: "sum(AMOUNT_SOLD/PROD_LIST_PRICE)")&lt;BR /&gt;&lt;IMG alt="blahblah.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/86039_blahblah.jpg" style="height: 164px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;And here's what I got when nothing is selected:&lt;IMG alt="blahblah2.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/86040_blahblah2.png" style="height: 308px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The idea is to just show 1999 rows, with in the first expression column those values (well, without the 0 for 1998 obviously) and in the second one getting sum(AMOUNT_SOLD/PROD_LIST_PRICE) for year in row MINUS sum(AMOUNT_SOLD/PROD_LIST_PRICE) for year before that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks again for your help ! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 May 2015 13:00:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-on-Year-minus-Sales-on-Previous-Year/m-p/891893#M1008158</guid>
      <dc:creator />
      <dc:date>2015-05-08T13:00:04Z</dc:date>
    </item>
  </channel>
</rss>

