<?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 Sales selected months last year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987706#M336752</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get sales for selected period last year?&lt;/P&gt;&lt;P&gt;If user selects 2015-03, how can I get sales for 2014-03?&lt;/P&gt;&lt;P&gt;See attached,&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2015 20:56:48 GMT</pubDate>
    <dc:creator>annabergendal</dc:creator>
    <dc:date>2015-11-25T20:56:48Z</dc:date>
    <item>
      <title>Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987706#M336752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I get sales for selected period last year?&lt;/P&gt;&lt;P&gt;If user selects 2015-03, how can I get sales for 2014-03?&lt;/P&gt;&lt;P&gt;See attached,&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 20:56:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987706#M336752</guid>
      <dc:creator>annabergendal</dc:creator>
      <dc:date>2015-11-25T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987707#M336753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=If(Sum(Sales) &amp;gt; 0, Above(Sum({&amp;lt;YeasrMonth=&amp;gt;}Sales)))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 21:01:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987707#M336753</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-11-25T21:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987708#M336754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;but that does not work.&lt;/P&gt;&lt;P&gt;It gives me previous months sales, not previous year current months sales.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:17:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987708#M336754</guid>
      <dc:creator>annabergendal</dc:creator>
      <dc:date>2015-11-26T07:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987709#M336755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;For this kind of comparisons, I always calculate a "MonthID" in the script:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(num(Year(Date))-1)*12 + Month(Date) as MonthID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In your expressions you can use afterwards:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({$&amp;lt;MonthID = {$(=Max(MonthID)-12)} &amp;gt;} Amount) for month in previous year&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({$&amp;lt;MonthID = {$(=Max(MonthID))} &amp;gt;} Amount) for month in current year&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this helps!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987709#M336755</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T07:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987710#M336756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=sum({&amp;lt;YeasrMonth={"$(=Left(YeasrMonth,4)-1&amp;amp;'-'&amp;amp;Right(YeasrMonth,2))"}&amp;gt;}Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:24:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987710#M336756</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-11-26T07:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987711#M336757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;YeasrMonth={"$(=Date(Addmonths(Date#(YeasrMonth,'YYYY-MM'),-12),'YYYY-MM'))"}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:41:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987711#M336757</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-11-26T07:41:57Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987712#M336758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;but none of these work for selection of several months.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:44:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987712#M336758</guid>
      <dc:creator>annabergendal</dc:creator>
      <dc:date>2015-11-26T07:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987713#M336759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;YearMonth={"$(=Date(Addmonths(Date#(YearMonth,'YYYY-MM'),-12),'YYYY-MM'))"}&amp;gt;}Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:48:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987713#M336759</guid>
      <dc:creator />
      <dc:date>2015-11-26T07:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987714#M336760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;At script level in your calender table, create this first: &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Year*12 + num(Month(Date)) as MonthID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In your expressions you can use afterwards:&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Sum({&amp;lt;MonthID = {'=$(=Max(MonthID)-12)'} &amp;gt;} Amount) for month in previous year&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Sum({&amp;lt;MonthID = {'=$(=Max(MonthID))'} &amp;gt;} Amount) for month in current year&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Hope this will help!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 07:49:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987714#M336760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-11-26T07:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987715#M336761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For multiple months selection try like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;YeasrMonth={$(&lt;EM&gt;vPreYrMonths&lt;/EM&gt;)}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where,&lt;/P&gt;&lt;P&gt;&lt;EM&gt; vPreYrMonths =Concat( DISTINCT chr(39)&amp;amp;(Left(YeasrMonth,4)-1)&amp;amp;'-'&amp;amp;Right(YeasrMonth,2)&amp;amp;chr(39) , ',')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;PFA&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 08:05:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987715#M336761</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2015-11-26T08:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987716#M336762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;Then Try,&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;EM&gt;sum({&amp;lt;YeasrMonth={$(=Concat(Chr(39)&amp;amp;Date(Addmonths(Date#(YeasrMonth,'YYYY-MM'),-12),'YYYY-MM')&amp;amp; Chr(39),','))}&amp;gt;}Sales)&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 08:09:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987716#M336762</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-11-26T08:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sales selected months last year</title>
      <link>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987717#M336763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks tresesco and Tamil!&lt;/P&gt;&lt;P&gt;Your idea of defining an interval in the variable works!&lt;/P&gt;&lt;P&gt;Thanks to both of you, and also others who replied to this.&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Anna&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Nov 2015 08:34:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sales-selected-months-last-year/m-p/987717#M336763</guid>
      <dc:creator>annabergendal</dc:creator>
      <dc:date>2015-11-26T08:34:31Z</dc:date>
    </item>
  </channel>
</rss>

