<?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 Select Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286171#M106455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming your only date field is the [Report Date], and assuming the format is MM/DD/YYYY, you can use action (no need for macro) like this:&lt;BR /&gt;Action: select in field&lt;BR /&gt;Field: [Report Date]&lt;BR /&gt;Search string:&lt;BR /&gt;=num(month(max([Report Date])),'00') &amp;amp; '/??/' &amp;amp; num(year(max([Report Date]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will select all values in the [Report Date] which are in the same month as the max [Report Date]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jan 2012 01:06:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-19T01:06:49Z</dc:date>
    <item>
      <title>Select Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286170#M106454</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;What I want to do is REALLY simple.. so I must be thick as I can't get this to work!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I load my data I have a field [Report Date] linked to all my data, then I use calendar to create a MaxDate field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a macro (to link to a button) to select all the [Report Date] data linked to this month, i.e. month of the MaxDate field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I want to say is Year(MaxDate) = Year[Report Date] and Month[MaxDate]=Month[Report Date] but am not sure of syntax to use in the macro, can anyone point me in the right direction?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 15:13:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286170#M106454</guid>
      <dc:creator />
      <dc:date>2012-01-18T15:13:40Z</dc:date>
    </item>
    <item>
      <title>Select Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286171#M106455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming your only date field is the [Report Date], and assuming the format is MM/DD/YYYY, you can use action (no need for macro) like this:&lt;BR /&gt;Action: select in field&lt;BR /&gt;Field: [Report Date]&lt;BR /&gt;Search string:&lt;BR /&gt;=num(month(max([Report Date])),'00') &amp;amp; '/??/' &amp;amp; num(year(max([Report Date]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will select all values in the [Report Date] which are in the same month as the max [Report Date]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 01:06:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286171#M106455</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-19T01:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286172#M106456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;We're using v8.5 so I'm not sure if actions will do the trick &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Phil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2012 08:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286172#M106456</guid>
      <dc:creator />
      <dc:date>2012-01-19T08:05:11Z</dc:date>
    </item>
    <item>
      <title>Select Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286173#M106457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Phil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub SelectDates&lt;BR /&gt; set rd = ActiveDocument.Fields("Report Date") &lt;BR /&gt; e = ActiveDocument.Evaluate("=monthstart(MaxDate)") &lt;/P&gt;&lt;P&gt; rd.Select "&amp;gt;=" &amp;amp; e &lt;/P&gt;&lt;P&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are dates later than max date in the list, it will be a little different:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sub SelectDates&lt;BR /&gt; set rd = ActiveDocument.Fields("Report Date") &lt;/P&gt;&lt;P&gt;e = ActiveDocument.Evaluate("=monthstart(MaxDate)") &lt;BR /&gt; l = ActiveDocument.Evaluate("=monthend(MaxDate)") &lt;BR /&gt; rd.Select "&amp;gt;=" &amp;amp; e &amp;amp; "&amp;lt;=" &amp;amp; l&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;end sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Hope I didn't miss much...)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 18:04:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-Macro/m-p/286173#M106457</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-08T18:04:19Z</dc:date>
    </item>
  </channel>
</rss>

