<?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 Current Year and Previous Year Calculation in one Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Current-Year-and-Previous-Year-Calculation-in-one-Expression/m-p/527755#M197218</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 want to calculate current year and previous year in one expression. Bascially:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I have MonthYear as Sept 2013 then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for Current year: it should start from July 2013-Sept 2013&lt;/P&gt;&lt;P&gt;for Previous year: it should start from July 2012-Sept 2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this formula it gives correct value for current year but for previous year it calculates the whole year (July 2012-June 2013). I want it to stop at Sept 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;CalMonthYear=,Date={"&amp;gt;=$(=Date(Yearstart(Max(Date),-1,7),'MM/DD/YYYY'))&amp;lt;=$(=Max(Date))"}&amp;gt;}Cases) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Dec 2013 21:18:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-12-04T21:18:22Z</dc:date>
    <item>
      <title>Current Year and Previous Year Calculation in one Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Year-and-Previous-Year-Calculation-in-one-Expression/m-p/527755#M197218</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 want to calculate current year and previous year in one expression. Bascially:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if I have MonthYear as Sept 2013 then:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for Current year: it should start from July 2013-Sept 2013&lt;/P&gt;&lt;P&gt;for Previous year: it should start from July 2012-Sept 2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this formula it gives correct value for current year but for previous year it calculates the whole year (July 2012-June 2013). I want it to stop at Sept 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;CalMonthYear=,Date={"&amp;gt;=$(=Date(Yearstart(Max(Date),-1,7),'MM/DD/YYYY'))&amp;lt;=$(=Max(Date))"}&amp;gt;}Cases) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 21:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Year-and-Previous-Year-Calculation-in-one-Expression/m-p/527755#M197218</guid>
      <dc:creator />
      <dc:date>2013-12-04T21:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Current Year and Previous Year Calculation in one Expression</title>
      <link>https://community.qlik.com/t5/QlikView/Current-Year-and-Previous-Year-Calculation-in-one-Expression/m-p/527756#M197219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For Current Year&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(=Date(AddMonths(MonthYear,-2),'MMM YYYY')) &amp;lt;=$(=Date(MonthYear,'MMM YYYY'))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;For Previous Year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;MonthYear&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"&amp;gt;=$(=Date(AddMonths(AddYears(MonthYear,-1),-2),'MMM YYYY')) &amp;lt;=$(=Date(AddYears(MonthYear,-1),'MMM YYYY'))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;SALE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Change appropriate field name as per your data model..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;i.e. SALE to Cases, MonthYear to CalMonthYear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 22:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Current-Year-and-Previous-Year-Calculation-in-one-Expression/m-p/527756#M197219</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2013-12-04T22:32:51Z</dc:date>
    </item>
  </channel>
</rss>

