<?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 MonthsEnd() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MonthsEnd/m-p/364211#M135510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Monthend(date) returns end date of the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while Monthsend is a little complex function, but I will try my best to explain.&lt;/P&gt;&lt;P&gt;Syntax for monthsend is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="Bold"&gt;MonthsEnd(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;n, date [, shift = 0 [, first_month_of_year = 1]]&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;where n is period to divide a year and will refer to values which divides 12 perfectly (so, n can be 1, 2, 3, 4, 6)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;monthsend ( 3, '2001-10-19', 0, 2 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;here n =3 i.e. 12/3 so, we have 4 periods in 1 year (for e.g take it as 4 quarters)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;then date = 2001-10-19 (YYYY-MM-DD)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;then shift = 0 i.e. we want it to return end date of the period in which this date falls. if we give -1 here that will give end date of the previous period and positive value say 1 will give end date of next period.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;first_month_of_period = 2 i.e. our year starts from feb not from jan.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;So, our 4 periods will be (feb - apr, may- jul, aug- oct, nov- jan)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;this date (2001-10-19) is of Oct month which falls in aug - oct period and last date of that period will be 2001-10-31.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;So, this will return (2001-10-31).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Hope this answers and explains you monthsend() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Ashutosh&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Apr 2012 17:41:07 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-04-23T17:41:07Z</dc:date>
    <item>
      <title>MonthsEnd()</title>
      <link>https://community.qlik.com/t5/QlikView/MonthsEnd/m-p/364210#M135509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can Anyone explain how monthsend() works with a simple example??????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 16:58:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthsEnd/m-p/364210#M135509</guid>
      <dc:creator />
      <dc:date>2012-04-23T16:58:43Z</dc:date>
    </item>
    <item>
      <title>MonthsEnd()</title>
      <link>https://community.qlik.com/t5/QlikView/MonthsEnd/m-p/364211#M135510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;Monthend(date) returns end date of the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while Monthsend is a little complex function, but I will try my best to explain.&lt;/P&gt;&lt;P&gt;Syntax for monthsend is:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="Bold"&gt;MonthsEnd(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;n, date [, shift = 0 [, first_month_of_year = 1]]&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;where n is period to divide a year and will refer to values which divides 12 perfectly (so, n can be 1, 2, 3, 4, 6)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;monthsend ( 3, '2001-10-19', 0, 2 )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;here n =3 i.e. 12/3 so, we have 4 periods in 1 year (for e.g take it as 4 quarters)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;then date = 2001-10-19 (YYYY-MM-DD)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;then shift = 0 i.e. we want it to return end date of the period in which this date falls. if we give -1 here that will give end date of the previous period and positive value say 1 will give end date of next period.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;first_month_of_period = 2 i.e. our year starts from feb not from jan.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;So, our 4 periods will be (feb - apr, may- jul, aug- oct, nov- jan)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;this date (2001-10-19) is of Oct month which falls in aug - oct period and last date of that period will be 2001-10-31.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;So, this will return (2001-10-31).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Hope this answers and explains you monthsend() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;Ashutosh&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2012 17:41:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthsEnd/m-p/364211#M135510</guid>
      <dc:creator />
      <dc:date>2012-04-23T17:41:07Z</dc:date>
    </item>
  </channel>
</rss>

