<?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 sum for previous month/(previous YearMonth) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944608#M325412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing issue with below requirement.&lt;/P&gt;&lt;P&gt;I have a expression as 1)&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(&amp;nbsp; {&amp;lt;Type={'123'}&amp;gt;}&amp;nbsp;&amp;nbsp; sales). &lt;/P&gt;&lt;P&gt;This give me the sum for YearMonth selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create one more field which will provide the sum for previous month/(previous YearMonth).&lt;/P&gt;&lt;P&gt;I am getting that using addmonths(YearMonth, -1).&amp;nbsp; However I am getting error while I integrate this in above expression (1).&lt;/P&gt;&lt;P&gt;I am trying something like&amp;nbsp;&amp;nbsp; -- &amp;gt;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;sum(&amp;nbsp; {&amp;lt;Type={'123'}, YearMonth= &lt;SPAN style="font-size: 13.3333px;"&gt;addmonths(YearMonth, -1)&lt;/SPAN&gt; &amp;gt;}&amp;nbsp;&amp;nbsp; sales).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But it is not working .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me correct above expression. In Expression 1) I need to add logic for previous YearMonth ...&lt;/P&gt;&lt;P&gt;&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>Sun, 27 Sep 2015 06:23:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-09-27T06:23:24Z</dc:date>
    <item>
      <title>sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944608#M325412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am facing issue with below requirement.&lt;/P&gt;&lt;P&gt;I have a expression as 1)&amp;nbsp;&amp;nbsp;&amp;nbsp; sum(&amp;nbsp; {&amp;lt;Type={'123'}&amp;gt;}&amp;nbsp;&amp;nbsp; sales). &lt;/P&gt;&lt;P&gt;This give me the sum for YearMonth selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create one more field which will provide the sum for previous month/(previous YearMonth).&lt;/P&gt;&lt;P&gt;I am getting that using addmonths(YearMonth, -1).&amp;nbsp; However I am getting error while I integrate this in above expression (1).&lt;/P&gt;&lt;P&gt;I am trying something like&amp;nbsp;&amp;nbsp; -- &amp;gt;&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;sum(&amp;nbsp; {&amp;lt;Type={'123'}, YearMonth= &lt;SPAN style="font-size: 13.3333px;"&gt;addmonths(YearMonth, -1)&lt;/SPAN&gt; &amp;gt;}&amp;nbsp;&amp;nbsp; sales).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But it is not working .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me correct above expression. In Expression 1) I need to add logic for previous YearMonth ...&lt;/P&gt;&lt;P&gt;&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>Sun, 27 Sep 2015 06:23:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944608#M325412</guid>
      <dc:creator />
      <dc:date>2015-09-27T06:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944609#M325413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using this in a chart where YearMonth is a dimension?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 16:04:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944609#M325413</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-09-27T16:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944610#M325414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe you need to format the result of addmonths as your YearMonth field, example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$ &amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Type={'123'},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt;={'$(=date(addmonths(max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;YearMonth&lt;/SPAN&gt;),-1),'YYYY MM'))'}&amp;gt;} sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 16:13:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944610#M325414</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-09-27T16:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944611#M325415</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 think it is a formatting problem like maxgro stated.&lt;/P&gt;&lt;P&gt;Try to give a look to the sample attached, I am using a variable to hold the previous month in the following format:&lt;/P&gt;&lt;P&gt;YYYY-MM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Patric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 18:17:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944611#M325415</guid>
      <dc:creator>pamaxeed</dc:creator>
      <dc:date>2015-09-27T18:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944612#M325416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I usually do this by creating a MonthCounter-field in my master calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&lt;/P&gt;&lt;P&gt;load %Datekey,&lt;/P&gt;&lt;P&gt;%Datekey as Date,&lt;/P&gt;&lt;P&gt;Year(%DateKey)&amp;amp;'-'&amp;amp;Month(%Datekey) as YearMonth,&lt;/P&gt;&lt;P&gt;Autonumber(&lt;SPAN style="font-size: 13.3333px;"&gt;Year(%DateKey)&amp;amp;'-'&amp;amp;Month(%Datekey),'MonthCounter') as MonthCounter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;resident tempDates order by %DateKey asc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can use the expression&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum({$ &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Type={'123'},&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;YearMonth&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=, MonthCounter={$(=Max(MonthCounter)-1)}&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;gt;} sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SKG&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Sep 2015 22:08:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944612#M325416</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-09-27T22:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944613#M325417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. I am using in chart as a Set analysis expression.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Sep 2015 07:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944613#M325417</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-28T07:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944614#M325418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Maxgro.. It worked for me with slight change.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please explain me how/where&amp;nbsp; to use the $ and '=' which u used before date.&amp;nbsp; I do not understand how to write these set analysis explression.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Sep 2015 18:22:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944614#M325418</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-09-30T18:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: sum for previous month/(previous YearMonth)</title>
      <link>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944615#M325419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dollar sign expansion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't explain better than Henric&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3444"&gt;The Magic of Dollar Expansions&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Oct 2015 07:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/sum-for-previous-month-previous-YearMonth/m-p/944615#M325419</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-10-01T07:29:43Z</dc:date>
    </item>
  </channel>
</rss>

