<?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 How to use Monthend() in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456792#M490218</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;i creted in my script two flags,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490929962205195" jivemacro_uid="_13490929962205195"&gt;&lt;P&gt;if(CalendarDate=MonthStart(CalendarDate),1,0) as Start_Flag&amp;nbsp;&amp;nbsp; //in the aim to know if is the first day of the month&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and a second :&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490929962183762" jivemacro_uid="_13490929962183762"&gt;&lt;P&gt;if(CalendarDate=MonthEnd(CalendarDate),1,0) as end_Flag&amp;nbsp;&amp;nbsp; //to know if is the last day in the month&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the second doesn't work !! &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;it gives me&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;0 to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;all&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;fields.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you help me ?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Oct 2012 12:02:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-10-01T12:02:31Z</dc:date>
    <item>
      <title>How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456792#M490218</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;i creted in my script two flags,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490929962205195" jivemacro_uid="_13490929962205195"&gt;&lt;P&gt;if(CalendarDate=MonthStart(CalendarDate),1,0) as Start_Flag&amp;nbsp;&amp;nbsp; //in the aim to know if is the first day of the month&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and a second :&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490929962183762" jivemacro_uid="_13490929962183762"&gt;&lt;P&gt;if(CalendarDate=MonthEnd(CalendarDate),1,0) as end_Flag&amp;nbsp;&amp;nbsp; //to know if is the last day in the month&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the second doesn't work !! &lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;it gives me&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;0 to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;all&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;fields.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you help me ?!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456792#M490218</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-01T12:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456793#M490219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Monthend will return the timestamp&amp;nbsp; of the last millisecond of the last day in the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use &lt;/P&gt;&lt;P&gt;daystart(monthend(...)) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when comparing to a DATE field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456793#M490219</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-01T12:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456794#M490220</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;MonthEnd() returns the latest fraction of the latest second of the latest date, i. e.: 40100,9999, and date values are integers by default, so in short, this is likely to work, as long as your CalendarDate field is recognized as a date field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490931812091527" jivemacro_uid="_13490931812091527"&gt;&lt;P&gt;&lt;CODE class="jive-code jive-sql"&gt;if(CalendarDate=Date(Floor(MonthEnd(CalendarDate))),1,0) &lt;SPAN class="jive-sql-keyword"&gt;as&lt;/SPAN&gt; end_Flag&lt;/CODE&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:07:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456794#M490220</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-10-01T12:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456795#M490221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool, it works &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i'm wondering why with MonthStart It Worked ???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:11:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456795#M490221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-01T12:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456796#M490222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nassim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13490943206301314" jivemacro_uid="_13490943206301314"&gt;&lt;P&gt;Num(MonthEnd('01/10/2012')) = 41213,99999998 // 31/12/2012 23:59:59.9999 (decimal)&lt;/P&gt;&lt;P&gt;Num(MonthStart('01/10/2012')) = 41183,0000000 = 41183 // 01/10/2012 00:00:00.0000 (integer)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's why the *Start() function always return an integer value while the *End functions do not. Even if you use the Date() function, the subjacent numeric value will keep the decimal positions, although it will show as a date "31/10/2012", that's why you need to somewhat get rid of them. The Floor() function keeps the integer part of a decimal number or expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that makes sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:18:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456796#M490222</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-10-01T12:18:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456797#M490223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks again &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 12:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456797#M490223</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-01T12:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456798#M490224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;come to you&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for help.&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;after having&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;used my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;if(CalendarDate=Date(Floor(MonthStart(CalendarDate))),1,0) as Start_Flag,&lt;/LI&gt;&lt;LI&gt;if(CalendarDate=Date(Floor(MonthEnd(CalendarDate))),1,0) as End_Flag,&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt; &lt;SPAN class="hps"&gt;I am trying to&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;display the data&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;according to these&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;flag.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;=sum({$&amp;lt;Start_Flag={"1"}&amp;gt;} nr_pmc_b)&lt;/LI&gt;&lt;LI&gt;=sum({$&amp;lt;End_Flag={"1"}&amp;gt;} nr_pmc)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt; &lt;SPAN class="hps"&gt;on&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;its&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;home&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;market&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;but not the&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;end&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;how&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;does that happen?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 16:52:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456798#M490224</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-01T16:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456799#M490225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nassim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the flag field Start_Flag does work but not the End_Flag? Are both date fields the same format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 16:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456799#M490225</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-10-01T16:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456800#M490226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes of course ,&lt;/P&gt;&lt;P&gt;as you see, the flags works perfectly :&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but as you see, i've got my Beginning PMC " sum(nr_pmc) for the first day of the month ,but not the endong pmc "sum(nr_pmc) for the last day of the month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 07:48:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456800#M490226</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-02T07:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456801#M490227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nassim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm unable to see your pictures, can you please attach them instead of posting?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 08:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456801#M490227</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-10-02T08:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Monthend()</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456802#M490228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I found my&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;problem&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;BR /&gt; &lt;SPAN class="hps atn"&gt;I used "&lt;/SPAN&gt;&lt;SPAN&gt;nr_pmc_b&lt;/SPAN&gt;" &lt;SPAN class="hps"&gt;alias&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;QV&lt;/SPAN&gt;&lt;SPAN class="atn"&gt;, and a "&lt;/SPAN&gt;nr_pmc" for &lt;SPAN class="hps"&gt;OLE DB,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;OLE&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;DB&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;turns&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;out&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;that&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;the fields&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in capital letters,&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;so I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;had to use&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;NR_PMC&lt;/SPAN&gt;.&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;simple&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;SPAN class="hps"&gt;thank you.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 10:02:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Monthend/m-p/456802#M490228</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-02T10:02:42Z</dc:date>
    </item>
  </channel>
</rss>

