<?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: Comparing values between years in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898941#M1010942</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It show the same in year and previous year sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year is a dimension in my chart, but I don't know how to refer to the value of the dim in the expresion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( &amp;lt;year={actual value of the dim year - 1}&amp;nbsp; sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you use max()?&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>Thu, 07 May 2015 22:27:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-07T22:27:51Z</dc:date>
    <item>
      <title>Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898939#M1010940</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 have a table with this data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year - product - sales&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make an expersion to show the sales of previous year. I have year 2014 and 2013 in the same table in the field.&lt;/P&gt;&lt;P&gt;I want to know how can I show the data of sales of previous year in order to compare with data of this year.&lt;/P&gt;&lt;P&gt;I don't want to create a new table for 2013. I suppose is possible to do with all the data in the same table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year&amp;nbsp; product&amp;nbsp; sales&amp;nbsp;&amp;nbsp; sales previous year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2014&amp;nbsp;&amp;nbsp;&amp;nbsp; P1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 485&amp;nbsp;&amp;nbsp;&amp;nbsp; 500 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is like an above function but moving in one dimension.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tabla.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/85970_tabla.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 21:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898939#M1010940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-07T21:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898940#M1010941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The simplest solution is like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop the dimension called year and make two expressions like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( { &amp;lt;Year={2015}&amp;gt; } Sales )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum( { &amp;lt;Year={2014}&amp;gt; } Sales ) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can make them dynamic by using variables like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your load script:&lt;/P&gt;&lt;P&gt;SET Year0 = =Max(Year);&lt;/P&gt;&lt;P&gt;SET Year1 = =Max(Year)-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expressions should then be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sum( { &amp;lt;Year={$(Year0)}&amp;gt; } Sales )&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;and&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Sum( { &amp;lt;Year={$(Year1)}&amp;gt; } Sales ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 22:10:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898940#M1010941</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-07T22:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898941#M1010942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Petter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It show the same in year and previous year sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;year is a dimension in my chart, but I don't know how to refer to the value of the dim in the expresion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( &amp;lt;year={actual value of the dim year - 1}&amp;nbsp; sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you use max()?&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>Thu, 07 May 2015 22:27:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898941#M1010942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-07T22:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898942#M1010943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I modified my first post ... because I was a bit too quick ... did you look at my modified suggestion? I actually verified in a small app that it worked ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 22:29:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898942#M1010943</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-07T22:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898943#M1010944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this should give you the previous year sales &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt; &lt;SPAN style="font-size: 13.3333330154419px;"&gt;anio&lt;/SPAN&gt;= {"$(=(max(anio,2))}&amp;gt;}ventas)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the reason why max is used is because the assumption that the greatest year is equal to the current year&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 22:35:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898943#M1010944</guid>
      <dc:creator>ramoncova06</dc:creator>
      <dc:date>2015-05-07T22:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898944#M1010945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks Petter, it works properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other way using the dim year and refering always to (year-1).&lt;/P&gt;&lt;P&gt;I don't know how many years can have my table.&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>Thu, 07 May 2015 22:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898944#M1010945</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-07T22:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing values between years</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898945#M1010946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you drop the Set Expression and have your two dimensions: Product and Year&lt;/P&gt;&lt;P&gt;Have the simple expression Sum( Sales )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And make a pivot chart ... drag the year up to the upper/top right and then you get all the years as columns...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2015 22:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-values-between-years/m-p/898945#M1010946</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-05-07T22:50:23Z</dc:date>
    </item>
  </channel>
</rss>

