<?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: Why does this SET stmt work for selecting a 3-char 'mmm' Month?? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499979#M1144271</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;Month = {"=Month=$(=max(Month))"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Sep 2013 20:13:56 GMT</pubDate>
    <dc:creator>whiteline</dc:creator>
    <dc:date>2013-09-09T20:13:56Z</dc:date>
    <item>
      <title>Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499978#M1144270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Hello all, I'm fairly new to the SET statement and I've been recently asked to make changes to an existing document. I came across the below code which selects the Maximum Year selected and the Maximum Month for the Maximum Year selected. The Year selection makes perfect sense to me. However. I do not understand why for the month the set is repeated and includes -1 at the end. I'm trying to learn and want to make some sense out of this syntax. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Also, does anyone know of another shorter syntax to acquire the Max Month here?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Month is in the format: Jan, Feb, Mar, ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks all in advance for any assistance here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;SPAN style="color: #000000;"&gt;Andreas&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #339966;"&gt;Sum(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;{$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #993300;"&gt;Year = {$(=max(Year))}&lt;/SPAN&gt;, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG style="color: #ff9900;"&gt;Month = {"&amp;lt;=$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month))&amp;gt;$(=max({&amp;lt;Year={$(=max(Year))}&amp;gt;} Month)-1)"}&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN style="color: #0000ff;"&gt;&amp;gt;}&lt;/SPAN&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt; [Sales Amount]&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 18:36:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499978#M1144270</guid>
      <dc:creator>ambetts2</dc:creator>
      <dc:date>2013-09-09T18:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499979#M1144271</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;Month = {"=Month=$(=max(Month))"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 20:13:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499979#M1144271</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-09-09T20:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499980#M1144272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GM whiteline and thanks for the response but this doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max() is returning a numeric say 09 and Month contains and alpha say 'Sep', so the two are not being matched.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also trine Num(Month)&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt; = {$(=max(Month))} but the statement did not like the function Num().&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:28:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499980#M1144272</guid>
      <dc:creator>ambetts2</dc:creator>
      <dc:date>2013-09-10T12:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499981#M1144273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried like?&lt;/P&gt;&lt;P&gt;Month={"$(=Month(Max(Month)))"}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:33:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499981#M1144273</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T12:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499982#M1144274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may try :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({$&amp;lt;Year = {'$(=max(Year))'}, Month = {'$(=Max({&amp;lt;Year={"$(=Max(Year))"}&amp;gt;}Month))'}&amp;gt;} [Sales Amount])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Som&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499982#M1144274</guid>
      <dc:creator>somenathroy</dc:creator>
      <dc:date>2013-09-10T12:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499983#M1144275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your existing exp. does say that the target month is less or equal to Max Month(Max Year) and greater than the Previous Month(Max Month(Max Year)) . It obviously does mean that target month is equal to Max Month(Max Year).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it would help you to decide over expr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Som&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:47:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499983#M1144275</guid>
      <dc:creator>somenathroy</dc:creator>
      <dc:date>2013-09-10T12:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499984#M1144278</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;If Month is text, like Jan, Feb, Mar..., then this should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month = {"$(=Date(MakeDate(Max(Year), max({&amp;lt;Year = {"$(=Max(Year))"}&amp;gt;} Month)), 'MMM'))"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 12:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499984#M1144278</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-09-10T12:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499985#M1144279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Max() is returning a numeric say 09 and Month contains and alpha say 'Sep', so the two are not being matched.&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;You don't even guess how it really works.&lt;/P&gt;&lt;P&gt;Max() can handle only numeric values, Max(Month) returns appropriate number because Month is dual (Both number and string).&lt;/P&gt;&lt;P&gt;QlikView can handle comparisons for duals like Month=9 but in set expression by default 'search' method is used instead.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 19:52:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499985#M1144279</guid>
      <dc:creator>whiteline</dc:creator>
      <dc:date>2013-09-10T19:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this SET stmt work for selecting a 3-char 'mmm' Month??</title>
      <link>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499986#M1144280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For that requirement I usually use a MonthYear field that is generated with the MonthName function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(&amp;nbsp; { $ &amp;lt;&amp;nbsp; MonthYear={"$(=MonthName(Max(MonthYear)))"} &amp;gt; }&amp;nbsp;&amp;nbsp;&amp;nbsp; [Sales Amount] )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 20:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-does-this-SET-stmt-work-for-selecting-a-3-char-mmm-Month/m-p/499986#M1144280</guid>
      <dc:creator>Carlos_Reyes</dc:creator>
      <dc:date>2013-09-10T20:10:43Z</dc:date>
    </item>
  </channel>
</rss>

