<?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: Month Function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705407#M254319</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please how do I give points? I am happy to..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Oct 2014 10:50:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-28T10:50:17Z</dc:date>
    <item>
      <title>Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705396#M254308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hi all,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This is what I am trying to write in QV.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;IF Sale Date MONTH = LAST MONTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Return 'Value1'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;ELSE 'Value2' AS [This Month]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;STRONG style=": ; mso-bidi-font-family: 'Times New Roman'; color: blue; font-size: 8pt; mso-hansi-theme-font: minor-latin; mso-ascii-theme-font: minor-latin; font-family: 'Calibri','sans-serif'; mso-bidi-theme-font: minor-bidi;"&gt;LOAD&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: maroon;"&gt;[Client]&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: maroon;"&gt;[Sale&amp;nbsp; Date]&lt;/SPAN&gt;,&lt;/SPAN&gt; &lt;BR /&gt;&lt;SPAN style="color: blue; font-family: 'Courier New';"&gt;&lt;STRONG style="font-size: 12pt;"&gt;IF&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: red; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-family: 'Courier New';"&gt;MONTH&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New';"&gt;[Sale Date]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New';"&gt;) = &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New';"&gt;MONTH&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New';"&gt;&lt;STRONG style="font-size: 12pt;"&gt;()-1,'Value1,'Value2')AS [This Month], &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: blue; font-size: 8pt;"&gt; FROM&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;[..\..\Data\DataSheel.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;SPAN style="color: blue;"&gt;ooxml&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;embedded&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;labels&lt;/SPAN&gt;, &lt;SPAN style="color: blue;"&gt;table&lt;/SPAN&gt; &lt;SPAN style="color: blue;"&gt;is&lt;/SPAN&gt; Sheet1); &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Please kindly assist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:13:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705396#M254308</guid>
      <dc:creator />
      <dc:date>2014-10-27T18:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705397#M254309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to evaluate if the Month on your Sale Date field is equal to the previous month (Based on a specific date (e.g. today's date)? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705397#M254309</guid>
      <dc:creator>albertovarela</dc:creator>
      <dc:date>2014-10-27T18:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705398#M254310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then write some thing like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[Client], &lt;BR /&gt;[Sale&amp;nbsp; Date], &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;IF( MONTH([Sale Date]) = Month( AddMonths( Today() ,-1)),'Value1','Value2') AS [This Month]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;BR /&gt;[..\..\Data\DataSheel.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Anand&lt;SPAN style="font-size: 8pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:25:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705398#M254310</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-10-27T18:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705399#M254311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if start of month of sale date is start of last month &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(floor(MonthStart([Sale Date])) = floor(addmonths(MonthStart(today()),-1)),&amp;nbsp; 'Value1', 'Value2) as ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:34:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705399#M254311</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-10-27T18:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705400#M254312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For more see this small example and i assume here you want previous month to as Value1 and rest Value2 for this see the small example load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tmp:&lt;/P&gt;&lt;P&gt;LOAD Date#( [Sale Date],'DD/MM/YYYY') as [Sale Date] ,Value;&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;Sale Date,Value&lt;/P&gt;&lt;P&gt;27/10/2014,458&lt;/P&gt;&lt;P&gt;27/10/2014,256&lt;/P&gt;&lt;P&gt;26/09/2014,284&lt;/P&gt;&lt;P&gt;26/10/2014,258&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;IF( MONTH([Sale Date]) = Month( AddMonths( Today() ,-1) ),'Value1','Value2')AS [This Month]&lt;/P&gt;&lt;P&gt;Resident tmp;&lt;/P&gt;&lt;P&gt;DROP Table tmp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you get&lt;/P&gt;&lt;P&gt;&lt;IMG alt="PreviousValue.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/69792_PreviousValue.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 18:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705400#M254312</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-10-27T18:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705401#M254313</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;in order to get only last months of the same year and to avoid issues with december/january combinations use MonthName instead of Month. This way you can also subtract one month from the current, as the MonthName function has an additional shift parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_139645_Pic1_.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69805_QlikCommunity_Thread_139645_Pic1_.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14144492584433926 jive_text_macro jive_macro_code" jivemacro_uid="_14144492584433926"&gt;
&lt;P&gt;tabSales:&lt;/P&gt;
&lt;P&gt;LOAD [Client],&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sale Date], &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MonthName([Sale Date]) = MonthName(Today(),-1),'Value1','Value2') as [This Month]&lt;/P&gt;
&lt;P&gt;INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Client, Sale Date&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 09/10/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 09/28/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 10/27/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 11/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 07/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 08/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 09/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 10/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 11/15/2014&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 07/15/2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 08/15/2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 09/15/2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 10/15/2013&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 11/15/2013&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 22:35:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705401#M254313</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-27T22:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705402#M254314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for all your contribution - please kindly excuse the delay in replying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried both Anand and Marco's suggestions below and they work well for me. I might end up going with Macro's suggestion simply because it accommodates January/December issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Anand: &lt;STRONG&gt;&lt;EM&gt;IF( MONTH([Sale Date]) = Month( AddMonths( Today() ,-1)),'Value1','Value2') AS [This Month]&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro:&lt;STRONG&gt; If(MonthName([Sale Date]) = MonthName(Today(),-1),'Value1','Value2') as [This Month]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am happy to close this discussion as 'answered'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 09:55:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705402#M254314</guid>
      <dc:creator />
      <dc:date>2014-10-28T09:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705403#M254315</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;glad to hear that you could solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark one of the threads as correct and/or helpful, that actually answered your question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:20:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705403#M254315</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-28T10:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705404#M254316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Do you want to give points to us for this &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;Regards&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:37:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705404#M254316</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-10-28T10:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705405#M254317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also like to say Massimo suggestion below is particularly useful, as it accommodates for January/December issue and also for 'if start of month of sale date is start of last month'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(floor(MonthStart([Sale Date])) = floor(addmonths(MonthStart(today()),-1)),&amp;nbsp; 'Value1', 'Value2') As [This Month]&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705405#M254317</guid>
      <dc:creator />
      <dc:date>2014-10-28T10:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705406#M254318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Massimo, Anand and your suggestions have been very helpful. I have marked Anand and yours. I am happy to mark Massimo but it is seem the option is not there on Massimo's windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:49:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705406#M254318</guid>
      <dc:creator />
      <dc:date>2014-10-28T10:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Month Function</title>
      <link>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705407#M254319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please how do I give points? I am happy to..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:50:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Month-Function/m-p/705407#M254319</guid>
      <dc:creator />
      <dc:date>2014-10-28T10:50:17Z</dc:date>
    </item>
  </channel>
</rss>

