<?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 month? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055263#M353826</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regardless of how many dates you have in a month, the expression should have worked. Not sure about your data model, so can't really offer much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, since you have already got it resolved, it would be helpful if you can close this thread by marking correct and helpful answers.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2016 11:36:07 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-05-02T11:36:07Z</dc:date>
    <item>
      <title>Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055259#M353822</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;Is there any way to get the previous month out from this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used for previous month: Year=Year(varMaxDate-7), value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whole script:&lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; {&amp;lt;[Campaign]={'1'}, [Value] = {"&amp;gt;$(=0)&amp;lt;$(=100)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(MonthNum=num(month(varMaxDate))-1 and Year=Year(varMaxDate-7),Value))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now I have a case where I need previous month.. And I can not use -30, 'cause this is monthly data that is coming on one certain day on every month. Do I have to chop it and then again bring it back to date?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Niko&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:18:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055259#M353822</guid>
      <dc:creator />
      <dc:date>2016-05-02T11:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055260#M353823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be like this:&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;Sum({&amp;lt;[Campaign]={'1'}, [Value] = {"&amp;gt;$(=0)&amp;lt;$(=100)"}, Date = {"$(='&amp;gt;=' &amp;amp; Date(MonthStart(Max(Date), -1), 'YourDateFieldFormatHere) &amp;amp; '&amp;lt;=' &amp;amp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date(MonthEnd(Max(Date), -1), 'YourDateFieldFormatHere))&lt;/SPAN&gt;"}, Month, Year&amp;gt;} &lt;/STRONG&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&lt;STRONG&gt;Value)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:22:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055260#M353823</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-02T11:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055261#M353824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you have Date field in your model then you can use the below expression for Previous month. Make sure that Your Date should not be string, it should be in proper Date format&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;nbsp; {&amp;lt;[Campaign]={'1'}, [Value] = {"&amp;gt;0&amp;lt;100"}, &lt;STRONG&gt;&lt;EM&gt;Date={"&amp;gt;=$(=monthstart(addmonths(max(Date),-1))) &amp;lt;=&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;&lt;EM&gt;$(=monthend(addmonths(max(Date),-1)))&lt;/EM&gt;&lt;/STRONG&gt; &lt;/SPAN&gt;"}&amp;gt;} &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Value])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:26:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055261#M353824</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-05-02T11:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055262#M353825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Sunny and Kushal for your help, actually this was what I was searching:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Year(addMonths(varMaxDate,-1))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your posts, I did manage to do that!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Those expressions that you made, I did not get them to work for some reason. Maybe the problem is that I only have one certain date for each month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Niko&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:33:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055262#M353825</guid>
      <dc:creator />
      <dc:date>2016-05-02T11:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055263#M353826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regardless of how many dates you have in a month, the expression should have worked. Not sure about your data model, so can't really offer much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Having said that, since you have already got it resolved, it would be helpful if you can close this thread by marking correct and helpful answers.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-14806"&gt;Qlik Community Tip: Marking Replies as Correct or Helpful&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sunny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:36:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055263#M353826</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-05-02T11:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: Previous month?</title>
      <link>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055264#M353827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no such restriction of Number of Dates.&amp;nbsp; may be Your Date is in string format, use date# to make it in Date format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 11:41:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Previous-month/m-p/1055264#M353827</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2016-05-02T11:41:15Z</dc:date>
    </item>
  </channel>
</rss>

