<?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: Set Analysis Prior Month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97383#M457722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if the code you helpfully provided is correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to clarify, the Date field is always the last day of the month. There won't be any dates between the first and the last, just the 31 first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2018 15:52:25 GMT</pubDate>
    <dc:creator>aetingu12</dc:creator>
    <dc:date>2018-09-05T15:52:25Z</dc:date>
    <item>
      <title>Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97381#M457720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have this set analysis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date= {"=monthend(addmonths(max(Date),-1))"} &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason it is always giving me the total Sales and not the month prior to the last available month.&amp;nbsp; I must be making a fundamental mistake in my code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Aksel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 15:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97381#M457720</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-05T15:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97382#M457721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/242903"&gt;aetingu12&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; Date={"&amp;gt;= AddMonths(MonthStart(Max(Date)),-1)&amp;lt;MonthStart(Max(Date))"} Sales&amp;gt;})&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajiv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 15:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97382#M457721</guid>
      <dc:creator>rajivmeher</dc:creator>
      <dc:date>2018-09-05T15:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97383#M457722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if the code you helpfully provided is correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to clarify, the Date field is always the last day of the month. There won't be any dates between the first and the last, just the 31 first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 15:52:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97383#M457722</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-05T15:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97384#M457723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Are you trying to look at the last day of the previous month? that's what monthend will do.&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;Without testing it looks like you may be missing $():&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;Calculate max date in a variable &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;=max(Date)&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;then in set analysis use :&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;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Sum({$&amp;lt;Date ={'$(=monthend(AddMonths('$(vmaxDate)', -1))'}&amp;gt;}&lt;/SPAN&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;&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;&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;I would actually just create a flag in the script, for example:&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;if(Month(Date) = Month(AddMonths(Today(),-1),1,0)&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;Or if you need the max(Date) rather than today() just create a temp table:&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;Temp:&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;Load&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;Max(Date) as max_Date,&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;min(Date) as min_Date&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;Resident &amp;lt;Main Fact&amp;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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;LET vMaxDate = peek('&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Temp&lt;/SPAN&gt;',0,max_Date);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create flag:&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;if(Month(Date) = Month(AddMonths($(&lt;SPAN style="font-size: 13.3333px;"&gt;vMaxDate&lt;/SPAN&gt;),-1),1,0) as previous_month_flag&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;Then your set analysis can simply be: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum({&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;previous_month_flag&lt;/SPAN&gt;= {1} &amp;gt;} Sales)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Hope that makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 15:54:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97384#M457723</guid>
      <dc:creator>joseph_eftamand</dc:creator>
      <dc:date>2018-09-05T15:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97385#M457724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/242903"&gt;aetingu12&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the feedback. Would it be possible to provide some sample data?&lt;/P&gt;&lt;P&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;Alternatively please try the following:&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-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;=sum({&amp;lt;Date= {"=DATE(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;MonthEnd(ADDMONTHS(MAX(DATE), -1)), 'YYYY-MM-DD')&lt;/SPAN&gt;"} &amp;gt;} Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Please change &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;'YYYY-MM-DD' to the format your have your data in. The issue seems to be MonthEnd function changes the format to datetime, where as you might have data in only date format.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sorry, if my answer is different from your requirement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Rajiv.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 16:14:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97385#M457724</guid>
      <dc:creator>rajivmeher</dc:creator>
      <dc:date>2018-09-05T16:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97386#M457725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought it would we a very simple task with just addmonths(max(date),-1) script.&amp;nbsp; All my dates are monthends, so yes I should not have included in my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dates are 31-03-2018, 30-04-2018, 31-05-2018 etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 16:24:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97386#M457725</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-05T16:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97387#M457726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you still having trouble with the dates? You may need to do some work on the formatting. If the above solution worked can you mark the answer as correct? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 16:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97387#M457726</guid>
      <dc:creator>joseph_eftamand</dc:creator>
      <dc:date>2018-09-05T16:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97388#M457727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/242903"&gt;aetingu12&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on your sample data the following should work fine.&lt;/P&gt;&lt;P&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;=sum({&amp;lt;Date= {"=DATE(&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;MonthEnd(ADDMONTHS(MAX(DATE), -1)), 'DD-MM-YYYY')&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;/P&gt;&lt;P&gt;Let me know if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajiv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 17:08:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97388#M457727</guid>
      <dc:creator>rajivmeher</dc:creator>
      <dc:date>2018-09-05T17:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97389#M457728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately yes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try just to get the correct date:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=AddMonths(max(Date),-1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do get the correct date, 30/06/2018. (Max date is 31/07/2018).&amp;nbsp; For some reason, I just can not insert it into my expression to get the sales numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically if I did: = Sum({&amp;lt;Date = {"30/06/2018"}&amp;gt;} Sales) it works.&amp;nbsp; It is just when I replace the string with the script. Even when I convert it to Date as:&lt;/P&gt;&lt;P&gt;=Date(AddMonths(max(Date),-1),'DD/MM/YYYY') it doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate all your help and patience.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 07:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97389#M457728</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-06T07:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97390#M457729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.qlik.com/qlik-users/242903"&gt;aetingu12&lt;/A&gt;‌.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will it be possible to share QVW with some sample data? It will be easier to troubleshoot the exact issue that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajiv.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 08:02:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97390#M457729</guid>
      <dc:creator>rajivmeher</dc:creator>
      <dc:date>2018-09-06T08:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97391#M457730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=sum({&amp;lt;Date= {"&amp;gt;=$(=AddMonths(max([Date]),-1))&amp;lt;=$(=month(max(([Date]))))"} &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kindly check Date field is recognized by qlik as field not function and try above set analysis &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 08:24:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97391#M457730</guid>
      <dc:creator>ebrahimaljafri</dc:creator>
      <dc:date>2018-09-06T08:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97392#M457731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aksel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We often have the same problem, e.g., pre-select the last 3 days or the last complete week or compare last month with month before and so on. Therefor we have a calendar qvd with all the valid day-week-month-quarter- and year relations. After loading the needed parts from this qvd we calculate a rank for each interesting calendar value: The current period gets rank "0", the period before gets "-1" and so on.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="212814" alt="Calendar with rank.png" class="jive-image image-1" src="/legacyfs/online/212814_Calendar with rank.png" style="height: 239px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;The set analysis gets much easier with this: Only({$&amp;lt;Month_Rank={"-1"}&amp;gt;} Month) gets the last month...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate the rank of a period you need three steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Get a distinct list of the calendar element&lt;/LI&gt;&lt;LI&gt;Add an order criteria within a sorted list of this distinct element --&amp;gt; the "rank"&lt;/LI&gt;&lt;LI&gt;Join the rank into your calendar&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Typical code looks like this:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="212819" alt="Calendar with rank - code snippet.png" class="jive-image image-2" src="/legacyfs/online/212819_Calendar with rank - code snippet.png" style="height: 172px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;You can do this for each period like "Week", "Month", ... If you want you can move this code snippet into a sub-routine and call it for each of your periods...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have fun!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 08:37:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97392#M457731</guid>
      <dc:creator>frank_dehner</dc:creator>
      <dc:date>2018-09-06T08:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97393#M457732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this.&lt;/P&gt;&lt;P&gt;This is giving me the sum of the last two months:)&lt;/P&gt;&lt;P&gt;Not the prettiest solution but with a little bit of tweak on the solution from &lt;A href="https://community.qlik.com/qlik-users/280433"&gt;ebrahimaljafri&lt;/A&gt; solved the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;Date= {"&amp;gt;=$(=AddMonths(max(Date),-1))&amp;lt;=$(=AddMonths(max(Date),-1))"} &amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess the question is, with set analysis we need to use either &amp;lt;= or &amp;gt;=, unless we script our variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The correct way to handle this should be in line with this article on &lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2015/09/28/dates-in-set-analysis"&gt;Dates in Set Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 10:13:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97393#M457732</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-06T10:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Prior Month</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97394#M457733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌brilliant idea!:))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2018 17:44:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Prior-Month/m-p/97394#M457733</guid>
      <dc:creator>aetingu12</dc:creator>
      <dc:date>2018-09-06T17:44:43Z</dc:date>
    </item>
  </channel>
</rss>

