<?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: Previous Months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120037#M369280</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin, Max can have a parameter to get the 2nd Max value:&lt;/P&gt;&lt;P&gt;Max(Month, 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when talking about something related to dates usually is better to use functions related to dates:&lt;/P&gt;&lt;P&gt;AddMonths(Max(Date), -2) // Will return a date two months earlier for the max date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Max(Date) is '01/02/2016' it will return '01/12/2015'. So Month(&lt;SPAN style="font-size: 13.3333px;"&gt;AddMonths(Max(Date), -2)) will return December, wich is two months before the max possible date.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2016 11:15:30 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2016-08-03T11:15:30Z</dc:date>
    <item>
      <title>Previous Months</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120035#M369278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been asked to produce a report that shows current month, last month and the month previous to that.&amp;nbsp; The way they'd like this to work is by having buttons for this month, last month and the month previous to that.&amp;nbsp; I can get this month to work "select" Max(Month) but how do i get the previous 2 months? Max(Month)-1 doesn't work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:03:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120035#M369278</guid>
      <dc:creator>kevbrown</dc:creator>
      <dc:date>2016-08-03T11:03:56Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Months</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120036#M369279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please share your application, in which its not working. Because in text box i checked that it is working fine.&lt;/P&gt;&lt;P&gt;Please share the exact requirement what you exactly want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raghvendra &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120036#M369279</guid>
      <dc:creator>raghvendrasingh</dc:creator>
      <dc:date>2016-08-03T11:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Months</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120037#M369280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin, Max can have a parameter to get the 2nd Max value:&lt;/P&gt;&lt;P&gt;Max(Month, 2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when talking about something related to dates usually is better to use functions related to dates:&lt;/P&gt;&lt;P&gt;AddMonths(Max(Date), -2) // Will return a date two months earlier for the max date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Max(Date) is '01/02/2016' it will return '01/12/2015'. So Month(&lt;SPAN style="font-size: 13.3333px;"&gt;AddMonths(Max(Date), -2)) will return December, wich is two months before the max possible date.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:15:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120037#M369280</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2016-08-03T11:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Months</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120038#M369281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you create a variable e.g. vSelectedMonth&lt;/P&gt;&lt;P&gt;button for this month you define Action Set Variable vSelectedMonth = max(Month)&lt;/P&gt;&lt;P&gt;button for last month you define Action Set Variable vSelectedMonth = date(addmonths(max(Month),-1))&lt;/P&gt;&lt;P&gt;button for month previous you define Action Set Variable vSelectedMonth = date(addmonths(max(Month),-2))&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;-&amp;gt; Month must be defined as datefield (not as text)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;in your table etc. you create Expression: sum({&amp;lt;Month={'$(=vSelectedMonth)'}&amp;gt;}Value&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:18:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120038#M369281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-03T11:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Previous Months</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120039#M369282</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;Date(Addmonths(max(Date),-1),'DD/MM/YYYY') for previous month&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Date(Addmonths(max(Date),-2),'DD/MM/YYYY') for two months ago&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;But if you are doing sum aggregate functions like sum or count you need to work on set analysis&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;like this ....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Date = {"$(='&amp;gt;=' &amp;amp; Date(MonthStart(Max(Date)), 'DateFieldFormatHere') &amp;amp; '&amp;lt;=' &amp;amp;Date(MonthEnd(Max(Date)), 'DateFieldFormatHere'))"} &amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2016 11:20:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-Months/m-p/1120039#M369282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-03T11:20:59Z</dc:date>
    </item>
  </channel>
</rss>

