<?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 Macro vbscript to set range between day 1 and today in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-vbscript-to-set-range-between-day-1-and-today/m-p/305049#M1185179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; I would like to select records starting from the 1st day of the month to the current day of the month.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;My first attempt:&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Sub firstSel&lt;BR /&gt; Set q = ActiveDocument&lt;BR /&gt; q.ClearAll (True)&lt;BR /&gt; Set f1=q.GetField("AV_FLOW_YEAR")&lt;BR /&gt; f1.select("2011")&lt;BR /&gt; Set f2=q.GetField("AV_FLOW_MONTH")&lt;BR /&gt; f2.select("09")&lt;BR /&gt; Set f3=q.GetField("DAY")&lt;BR /&gt; f3.select("&amp;gt;=1 &amp;lt;=today()")&lt;BR /&gt; 'would like to set range to be &amp;gt;=1 &amp;lt;=today()&lt;BR /&gt; End sub&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;However, today is not a value in vbScript&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Have tried datepart, to no avail&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;James&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Sep 2011 18:45:41 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-09-30T18:45:41Z</dc:date>
    <item>
      <title>Macro vbscript to set range between day 1 and today</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-vbscript-to-set-range-between-day-1-and-today/m-p/305049#M1185179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt; I would like to select records starting from the 1st day of the month to the current day of the month.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 10pt;"&gt;My first attempt:&lt;SPAN style="font-size: 10pt;"&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Sub firstSel&lt;BR /&gt; Set q = ActiveDocument&lt;BR /&gt; q.ClearAll (True)&lt;BR /&gt; Set f1=q.GetField("AV_FLOW_YEAR")&lt;BR /&gt; f1.select("2011")&lt;BR /&gt; Set f2=q.GetField("AV_FLOW_MONTH")&lt;BR /&gt; f2.select("09")&lt;BR /&gt; Set f3=q.GetField("DAY")&lt;BR /&gt; f3.select("&amp;gt;=1 &amp;lt;=today()")&lt;BR /&gt; 'would like to set range to be &amp;gt;=1 &amp;lt;=today()&lt;BR /&gt; End sub&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;However, today is not a value in vbScript&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Have tried datepart, to no avail&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;James&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 18:45:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-vbscript-to-set-range-between-day-1-and-today/m-p/305049#M1185179</guid>
      <dc:creator />
      <dc:date>2011-09-30T18:45:41Z</dc:date>
    </item>
    <item>
      <title>Macro vbscript to set range between day 1 and today</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-vbscript-to-set-range-between-day-1-and-today/m-p/305050#M1185180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sub firstSel&lt;BR /&gt; Set q = ActiveDocument&lt;BR /&gt; q.ClearAll (True)&lt;BR /&gt; Set f1=q.GetField("AV_FLOW_YEAR")&lt;BR /&gt; f1.select("2011")&lt;BR /&gt; Set f2=q.GetField("AV_FLOW_MONTH")&lt;BR /&gt; f2.select("09")&lt;BR /&gt; Set f3=q.GetField("DAY")&lt;BR /&gt; f3.select("&amp;gt;=1 &amp;lt;="&amp;amp;datepart("d",now()))&lt;BR /&gt; 'would like to set range to be &amp;gt;=1 &amp;lt;=today()&lt;BR /&gt; End sub &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;Looks like I found the answer, by using the &amp;amp; to append the value to the string expression used for the search criteria&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 19:04:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-vbscript-to-set-range-between-day-1-and-today/m-p/305050#M1185180</guid>
      <dc:creator />
      <dc:date>2011-09-30T19:04:21Z</dc:date>
    </item>
  </channel>
</rss>

