<?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 Last month, last year function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502709#M187849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have some problems with the last year and last month function.&lt;/P&gt;&lt;P&gt;I want to create a table like the following, with the sales of several months.&lt;/P&gt;&lt;P&gt;For instance at&lt;STRONG&gt; September 2013&lt;/STRONG&gt; if i select january - august &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;2013 it should display the sales of the &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;current year in sales 2013 (january - august) und the sales of the last year in sales 2012 (january - august) .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the other two fields i want to calculate the sales of the last month (august 2013) and august 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Unbenannt.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/46371_Unbenannt.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Use this expressions:&lt;/P&gt;&lt;P&gt;This two works fine, i mean if i select the january - mai 2010 i get the values for january - mai 2010 and january - mai 2009.&lt;/P&gt;&lt;P&gt;Sales 2013: Sum({$&amp;lt;Year={$(=Only(Year))}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;Sales 2012: Sum({$&amp;lt;Year={$(=Only(Year-1))}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work by these experessions i, i get null. Except i select the current month.&lt;/P&gt;&lt;P&gt;August 2013: sum( {$ &amp;lt; Year = {$(=Only(Jahr))}, Month = {$(=month(AddMonths(today(), -1)))} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;August 2012: sum( {$ &amp;lt; Year = {$(=Only(Jahr-1))}, Month = {$(=month(AddMonths(today(), -1)))} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 09:38:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-09-10T09:38:01Z</dc:date>
    <item>
      <title>Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502709#M187849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have some problems with the last year and last month function.&lt;/P&gt;&lt;P&gt;I want to create a table like the following, with the sales of several months.&lt;/P&gt;&lt;P&gt;For instance at&lt;STRONG&gt; September 2013&lt;/STRONG&gt; if i select january - august &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;2013 it should display the sales of the &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;current year in sales 2013 (january - august) und the sales of the last year in sales 2012 (january - august) .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the other two fields i want to calculate the sales of the last month (august 2013) and august 2012.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Unbenannt.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/46371_Unbenannt.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Use this expressions:&lt;/P&gt;&lt;P&gt;This two works fine, i mean if i select the january - mai 2010 i get the values for january - mai 2010 and january - mai 2009.&lt;/P&gt;&lt;P&gt;Sales 2013: Sum({$&amp;lt;Year={$(=Only(Year))}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;Sales 2012: Sum({$&amp;lt;Year={$(=Only(Year-1))}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't work by these experessions i, i get null. Except i select the current month.&lt;/P&gt;&lt;P&gt;August 2013: sum( {$ &amp;lt; Year = {$(=Only(Jahr))}, Month = {$(=month(AddMonths(today(), -1)))} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;August 2012: sum( {$ &amp;lt; Year = {$(=Only(Jahr-1))}, Month = {$(=month(AddMonths(today(), -1)))} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone can help me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502709#M187849</guid>
      <dc:creator />
      <dc:date>2013-09-10T09:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502710#M187850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;look at this example&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:41:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502710#M187850</guid>
      <dc:creator>michael_maeuser</dc:creator>
      <dc:date>2013-09-10T09:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502711#M187851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;August 2013: sum( {$ &amp;lt; Year = {$(=Only(Jahr))}, Month = {&lt;STRONG&gt;'&lt;/STRONG&gt;$(=month(AddMonths(today(), -1)))&lt;STRONG&gt;'&lt;/STRONG&gt;} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;August 2012: sum( {$ &amp;lt; Year = {$(=Only(Jahr-1))}, Month = {&lt;STRONG&gt;'&lt;/STRONG&gt;$(=month(AddMonths(today(), -1)))&lt;STRONG&gt;'&lt;/STRONG&gt;} &amp;gt;} Sales )&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, the additional quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 09:45:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502711#M187851</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T09:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502712#M187852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thx for your example!&lt;/P&gt;&lt;P&gt;I have tasted it in my qvw and it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But there is still a problem.&lt;/P&gt;&lt;P&gt;When i select for instance january 2013 i get the same year in the field vPriorMonthyear and vPriorYear.&lt;/P&gt;&lt;P&gt;And because of this reason i get the sales for december 2012 two times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Unbenannt.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/46379_Unbenannt.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="test.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/46380_test.JPG.jpg" style="width: 620px; height: 42px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:41:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502712#M187852</guid>
      <dc:creator />
      <dc:date>2013-09-10T11:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502713#M187853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, but with this expressions i have still the same problem as in my first post&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502713#M187853</guid>
      <dc:creator />
      <dc:date>2013-09-10T11:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502714#M187854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what does your expression look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YTD should be like this:&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Year={'$(vMaxYear)'},Month={'$(vMaxMonth)'},Day={'&amp;lt;=$(vMaxDay)'},Date=,MonthYear=&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for prior YTD:&lt;/P&gt;&lt;P&gt;SUM({&amp;lt;Year={'$(vPriorYear)'},Month={'$(vMaxMonth)'},Day={'&amp;lt;=$(vMaxDay)'},Date=,MonthYear=&amp;gt;}Amount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 11:50:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502714#M187854</guid>
      <dc:creator>michael_maeuser</dc:creator>
      <dc:date>2013-09-10T11:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502715#M187855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please share a sample app?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502715#M187855</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T12:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Last month, last year function</title>
      <link>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502716#M187856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all! Now it works &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here an example qvw, if someone need it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 07:26:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-month-last-year-function/m-p/502716#M187856</guid>
      <dc:creator />
      <dc:date>2013-09-11T07:26:14Z</dc:date>
    </item>
  </channel>
</rss>

