<?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: How do I compare current year to previous year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137164#M887931</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, then try like this at script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Financial_Year,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'20'&amp;amp;right(&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Financial_Year,2) as Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From YourExcel;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Variance Expression would be like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Year={'=$(=max(Year))'}&amp;gt;} Sales) - Sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;{'=$(=max(Year)-1)'}&lt;/SPAN&gt;&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Sep 2016 11:39:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-02T11:39:23Z</dc:date>
    <item>
      <title>How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137160#M887927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a Year field in my app but values are presented as an academic year spanning two calendar years e.g. 2015-16.&lt;/P&gt;&lt;P&gt;How do I write an expression that shows the variance between the current selected year and the previous year?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Greg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137160#M887927</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137161#M887928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have date field in script on which this academic year is created?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:24:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137161#M887928</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T11:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137162#M887929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;might be helpful?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3138"&gt;Fiscal Year&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137162#M887929</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T11:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137163#M887930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No.&amp;nbsp; I just have a Year field I get from a csv file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:32:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137163#M887930</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T11:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137164#M887931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, then try like this at script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Financial_Year,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'20'&amp;amp;right(&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;STRONG&gt;Financial_Year,2) as Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From YourExcel;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Variance Expression would be like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Year={'=$(=max(Year))'}&amp;gt;} Sales) - Sum({&amp;lt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;{'=$(=max(Year)-1)'}&lt;/SPAN&gt;&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:39:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137164#M887931</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T11:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137165#M887932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Balraj&lt;/P&gt;&lt;P&gt;Can I replace 'max' with 'currentselection'?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 11:44:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137165#M887932</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T11:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137166#M887933</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;Max will reflect Your current selection, if no selection then it will be max year in Your model.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 12:36:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137166#M887933</guid>
      <dc:creator>stabben23</dc:creator>
      <dc:date>2016-09-02T12:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137167#M887934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am having problems with the script.&amp;nbsp; My field is already named Year.&amp;nbsp; Do I need to change your suggested script to&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Year,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;'20'&amp;amp;right(Y&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.33px;"&gt;&lt;STRONG&gt;ear,2) as Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;I got syntax errors when I tried this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.33px;"&gt;Will this affect how my years are displayed in my list boxes.&amp;nbsp; I don't want that.&amp;nbsp; I need it to show as an academic year e.g. 2015-16.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 13:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137167#M887934</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-02T13:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137168#M887935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two are on the same fact table? If yes is simples, just create a calculated field year and enter the following script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The script load creates field year in the database&lt;/STRONG&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Fact_Sales:&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,YEAR(Date) AS Year&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Sales&lt;/P&gt;
&lt;P&gt;FROM Database\Sales.qvd (qvd);&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;The script compares the last year and previous year in the database&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({&amp;lt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year={'$(=Max(Year))'}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} Sales) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;- &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({&amp;lt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year={'$(=AddYears(Max(Year),-1))'}&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13.3333px; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have helped!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:21:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137168#M887935</guid>
      <dc:creator>branderbwcs</dc:creator>
      <dc:date>2016-09-02T14:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I compare current year to previous year</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137169#M887936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In script table you can't have same name for more than one column, it should be unique.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can do it like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Load&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;*,&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Year as Financial_Year,&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;'20'&amp;amp;right(Y&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3299999237061px; font-family: inherit;"&gt;ear,2) as Calender_Year&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3299999237061px; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.33px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3299999237061px; font-family: inherit;"&gt;For List box presentation you can use Financial_Year, and for Logic/Expression you can use Calender_Year&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2016 08:17:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-compare-current-year-to-previous-year/m-p/1137169#M887936</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-05T08:17:21Z</dc:date>
    </item>
  </channel>
</rss>

