<?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: MonthEnd date of Every month using For loop? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448944#M433899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vStartDate = AddYears(Date(&lt;SPAN style="font-size: 13.3333px;"&gt;DateField&lt;/SPAN&gt;),-1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vEndDate = &lt;SPAN style="font-size: 13.3333px;"&gt;Date(Max(DateField));&lt;/SPAN&gt;&lt;/STRONG&gt;&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;For i = vStartDate to vEndDate&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;LET vTemp=MonthEnd(DateField);;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;Sample:&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&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;Test&lt;/STRONG&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;$(vTemp)&lt;/STRONG&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;];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&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; STORE Sample into Path.qvd (qvd);&lt;/STRONG&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;Drop Table Sample;&lt;/STRONG&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;next i;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Aug 2017 05:18:14 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2017-08-23T05:18:14Z</dc:date>
    <item>
      <title>MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448941#M433896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need monthend date of every month using for loop() for last 12 months.&lt;/P&gt;&lt;P&gt;if month is completed it should give me the last date of the month and if month is not completed it should give Today-1 date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards &lt;/P&gt;&lt;P&gt;Amarnath Prajapati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 04:47:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448941#M433896</guid>
      <dc:creator>prajapatiamar38</dc:creator>
      <dc:date>2017-08-23T04:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448942#M433897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this instead of loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: line-through;"&gt;If(DateField &amp;gt;= Min(TOTAL DateField) and DateField &amp;lt;= Max(TOTAL DateField), MonthEnd(DateField)) as 12ME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="text-decoration: line-through;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;If(DateField &amp;gt;= &lt;SPAN style="color: #ff0000;"&gt;Max(TOTAL DateField)-365&lt;/SPAN&gt; and DateField &amp;lt;= Max(TOTAL DateField), MonthEnd(DateField)) as 12ME&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 04:49:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448942#M433897</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-23T04:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448943#M433898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want using loop only, I have used below code but it is giving me last day of this month also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;let vDateStart=date(MonthEnd(AddMonths(Today(),-11)),'YYYYMMDD');&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;for i=0 to 11&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LET vTemp=date(MonthEnd(AddMonths(vDateStart,$(i))),'YYYYMMDD');&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;LOAD * Inline [&lt;/P&gt;&lt;P&gt;Test&lt;/P&gt;&lt;P&gt;$(vTemp)&lt;/P&gt;&lt;P&gt;];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;next i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:05:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448943#M433898</guid>
      <dc:creator>prajapatiamar38</dc:creator>
      <dc:date>2017-08-23T05:05:51Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448944#M433899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vStartDate = AddYears(Date(&lt;SPAN style="font-size: 13.3333px;"&gt;DateField&lt;/SPAN&gt;),-1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vEndDate = &lt;SPAN style="font-size: 13.3333px;"&gt;Date(Max(DateField));&lt;/SPAN&gt;&lt;/STRONG&gt;&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;For i = vStartDate to vEndDate&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;LET vTemp=MonthEnd(DateField);;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;Sample:&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&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;Test&lt;/STRONG&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;$(vTemp)&lt;/STRONG&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;];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&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; STORE Sample into Path.qvd (qvd);&lt;/STRONG&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;Drop Table Sample;&lt;/STRONG&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;next i;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:18:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448944#M433899</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-08-23T05:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448945#M433900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;Load&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthEnd(Today(),-RecNo()) as Date&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;autogenerate 11;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;load&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Today()=MonthEnd(today()), today(), Date(today()-1)) as Date&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;AutoGenerate 1;&lt;/SPAN&gt;&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/174302_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:19:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448945#M433900</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-23T05:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448946#M433901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes got it thanks..&lt;/P&gt;&lt;P&gt;I have used your script to find the last 12 months last date as per my requirement, then i stored the same in variable using FieldValue().&lt;/P&gt;&lt;P&gt;Below is my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthEnd(Today(),-RecNo()) as Date&lt;/P&gt;&lt;P&gt;autogenerate 11;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Today()=MonthEnd(today()), today(), Date(today()-1)) as Date&lt;/P&gt;&lt;P&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a=1 to 12&lt;/P&gt;&lt;P&gt;v1=FieldValue('Date',$(a));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Test1&lt;/P&gt;&lt;P&gt;$(v1)&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT a;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:50:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448946#M433901</guid>
      <dc:creator>prajapatiamar38</dc:creator>
      <dc:date>2017-08-23T05:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: MonthEnd date of Every month using For loop?</title>
      <link>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448947#M433902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need really 12 variables, I guess you have to modify your code a bit like:&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;EM&gt;for a=1 to 12&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;v1&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;$(a)&lt;/STRONG&gt;&lt;/SPAN&gt;=FieldValue('Date',$(a));&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Note: Please mark 'helpful' and 'correct' as fit and close the thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Aug 2017 05:56:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/MonthEnd-date-of-Every-month-using-For-loop/m-p/1448947#M433902</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-08-23T05:56:17Z</dc:date>
    </item>
  </channel>
</rss>

