<?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 to select Previous Month from Current. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220056#M73004</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can create an variable with expression as below to get the previous month;&lt;/P&gt;&lt;P&gt;X=Month(AddMonths(today(),-1))&lt;/P&gt;&lt;P&gt;And select the month using macro&lt;/P&gt;&lt;P&gt;Get the variable as string&lt;/P&gt;&lt;P&gt;ActiveDocuemnt.Fields("[Start Date of Month]"). Select X&lt;/P&gt;&lt;P&gt;I hope the above will help you.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Apr 2010 08:31:46 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-04-21T08:31:46Z</dc:date>
    <item>
      <title>Macro to select Previous Month from Current.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220055#M73003</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;I wish to select previous month as soon I open a Qlikview Dashboard. I have tried various expression e.g.&lt;/P&gt;&lt;P&gt;I have a field called [Start Date of Month] to represent each month , so I tried ActiveDocument.GetField("Start Date of Month").Select ActiveDocument.Evaluate("=AddMonths(Max([Start Date of Month]),-1)") But Max([Start Date of Month]) work's with the Current month but when I use AddMonth with -1 for previous month the Time value I hope is truncated &amp;amp; it doesn't select Desired result.&lt;/P&gt;&lt;P&gt;I have tried various ways but because the Time Factor along with date get's truncated it is not working. If someone could give any suggestion. Thanks in advance&lt;/P&gt;&lt;P&gt;With Regards&lt;/P&gt;&lt;P&gt;Amar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 07:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220055#M73003</guid>
      <dc:creator>amars</dc:creator>
      <dc:date>2010-04-21T07:45:07Z</dc:date>
    </item>
    <item>
      <title>Macro to select Previous Month from Current.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220056#M73004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can create an variable with expression as below to get the previous month;&lt;/P&gt;&lt;P&gt;X=Month(AddMonths(today(),-1))&lt;/P&gt;&lt;P&gt;And select the month using macro&lt;/P&gt;&lt;P&gt;Get the variable as string&lt;/P&gt;&lt;P&gt;ActiveDocuemnt.Fields("[Start Date of Month]"). Select X&lt;/P&gt;&lt;P&gt;I hope the above will help you.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 08:31:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220056#M73004</guid>
      <dc:creator />
      <dc:date>2010-04-21T08:31:46Z</dc:date>
    </item>
    <item>
      <title>Macro to select Previous Month from Current.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220057#M73005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajesh,&lt;/P&gt;&lt;P&gt;It won't work since in my database [Start Date of Month] is an DateTime Field &amp;amp; in Qlikview Month(AddMonths(today(),-1)) will give me some value that just has a Date Value &amp;amp; not the time along with it so the selection don't work in this case. If some one has faced such a problem please reply.&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;P&gt;Amar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 04:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220057#M73005</guid>
      <dc:creator>amars</dc:creator>
      <dc:date>2010-04-22T04:43:01Z</dc:date>
    </item>
    <item>
      <title>Macro to select Previous Month from Current.</title>
      <link>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220058#M73006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;BR /&gt;&lt;BR /&gt;Create month from '[Start Date of Month]' filed in qlikview and use that field for selection.&lt;BR /&gt;&lt;BR /&gt;ActiveDocument.Fields("[CREATED MONTH]").Select X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 07:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Macro-to-select-Previous-Month-from-Current/m-p/220058#M73006</guid>
      <dc:creator />
      <dc:date>2010-04-22T07:08:19Z</dc:date>
    </item>
  </channel>
</rss>

