<?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: Need to export only current and previous year data in excel through Macro in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395239#M812850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about applying a filter using the Macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;activedocument.fields("&lt;STRONG style="font-family: Courier New;"&gt;Fiscal_Year&lt;/STRONG&gt;").select "2017"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Or Something similar?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Sep 2017 09:56:59 GMT</pubDate>
    <dc:creator>dmac1971</dc:creator>
    <dc:date>2017-09-22T09:56:59Z</dc:date>
    <item>
      <title>Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395236#M812847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black; font-size: 12pt; font-family: 'Courier New';"&gt;Hi All ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;Can anybody suggest me on below requirement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;I need to generate excel dump for Current and Previous Year.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;The below attached code generate data for all years.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;The variable &lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;&lt;STRONG&gt;vFisc_Year=&lt;STRONG style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;Fiscal_Year&lt;/STRONG&gt;&lt;/STRONG&gt; is my year field in application.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12pt; font-family: 'Courier New';"&gt;I tried changing variable to &lt;STRONG style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;vFisc_Year=max(Fiscal_Year)-1 but it did not work.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="color: #000000; font-family: 'Courier New';"&gt;&lt;STRONG style="color: #000000; font-family: 'Courier New'; font-size: 12px;"&gt;Kindly assist...&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;Your help will be apopreciated!!!!!!!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Sub Export&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; on error resume next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET Doc = ActiveDocument&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; 'Assign&amp;nbsp; Inv_year field to FieldName, because the report generates for each Inv_year&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET f = Doc.Variables("&lt;STRONG&gt;vFisc_Year&lt;/STRONG&gt;")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET f1 = Doc.Variables("vRegion")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET f2 = Doc.Variables("vReport_Type")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; FieldName = f.GetContent.STRING&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; FieldName1 = f1.GetContent.STRING&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; FieldName2 = f2.GetContent.STRING&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Doc.Fields(FieldName).Clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET Field = Doc.Fields(FieldName).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; For i=0 to Field.Count-1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Doc.Fields(FieldName).SELECT Field.Item(i).Text&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Doc.Fields(FieldName1).Clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET Field1= Doc.Fields(FieldName1).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; For j=0 to Field1.Count-1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Doc.Fields(FieldName1).SELECT Field1.Item(j).Text&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Doc.Fields(FieldName2).Clear&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; SET Field2 = Doc.Fields(FieldName2).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; For k=0 to Field2.Count-1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; Doc.Fields(FieldName2).SELECT Field2.Item(k).Text&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; Doc.GetApplication.WaitForIdle&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; Path = "E:\STEEL\Data\Excel\PL_BS_Excel\" &amp;amp;Field.Item(i).Text &amp;amp;"_" &amp;amp;Field1.Item(j).Text &amp;amp;"_" &amp;amp;Field2.Item(k).Text &amp;amp;".xls"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; set obj = Doc.GetSheetObject("CH230")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; obj.ExportBiff Path&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Next&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; ActiveDocument.Save&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; Application.Quit&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; End Sub &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395236#M812847</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395237#M812848</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;My Fiscal_Year&amp;nbsp; has value from 2011 to 2018.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; the above macro generate excel for all years. I need the macro code&amp;nbsp; which generate only last 2 year data(2017 and 2018)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tripati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 05:57:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395237#M812848</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2017-09-22T05:57:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395238#M812849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/3540"&gt;pcammaert&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-users/171708"&gt;stalwar1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 06:47:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395238#M812849</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2017-09-22T06:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395239#M812850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about applying a filter using the Macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;activedocument.fields("&lt;STRONG style="font-family: Courier New;"&gt;Fiscal_Year&lt;/STRONG&gt;").select "2017"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Or Something similar?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Sep 2017 09:56:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395239#M812850</guid>
      <dc:creator>dmac1971</dc:creator>
      <dc:date>2017-09-22T09:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395240#M812851</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;The code which you have given is hard coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we wants it as a dyanmic.&lt;/P&gt;&lt;P&gt;If nothing is selected, then previous year and current year will be selected automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tripati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Sep 2017 05:03:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395240#M812851</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2017-09-25T05:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395241#M812852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tripati,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Sub Export&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;on error resume next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Doc = ActiveDocument&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;'Assign&amp;nbsp; Inv_year field to FieldName, because the report generates for each Inv_year&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f = Doc.Variables("&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;vFisc_Year&lt;/STRONG&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f1 = Doc.Variables("vRegion")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f2 = Doc.Variables("vReport_Type")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName = f.GetContent.STRING&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName1 = f1.GetContent.STRING&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName2 = f2.GetContent.STRING&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field = Doc.Fields(FieldName).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For i=0 to Field.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;STRONG style=": ; color: #0000ff;"&gt;If Field.Item(i).Text = Trim(year(Now())) or Field.Item(i).Text = Trim(Year(Now())-1) then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName).SELECT Field.Item(i).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName1).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field1= Doc.Fields(FieldName1).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For j=0 to Field1.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName1).SELECT Field1.Item(j).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName2).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field2 = Doc.Fields(FieldName2).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For k=0 to Field2.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Doc.Fields(FieldName2).SELECT Field2.Item(k).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Doc.GetApplication.WaitForIdle&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Path = "E:\STEEL\Data\Excel\PL_BS_Excel\" &amp;amp;Field.Item(i).Text &amp;amp;"_" &amp;amp;Field1.Item(j).Text &amp;amp;"_" &amp;amp;Field2.Item(k).Text &amp;amp;".xls"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; set obj = Doc.GetSheetObject("CH230")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;obj.ExportBiff Path&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;End If&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt; font-family: 'Courier New';"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;ActiveDocument.Save&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Application.Quit&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Sep 2017 07:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395241#M812852</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2017-09-26T07:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395242#M812853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nagaraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks your solution.... it did work for me!!&lt;/P&gt;&lt;P&gt;But I am facing one issue when I reload the macro manually it is generating excel for 2 years which is as per expectation, but when the same code is ran through batch file(Windows task scheduler)&amp;nbsp; it is showing ambiguous&amp;nbsp; behavior the code generate few files for year 2016,few files for 2017 ,few files for 2018.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have verified Server time zone and date which is correct...!!!&lt;/P&gt;&lt;P&gt;Can you please suggest some solution on this...!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tripati&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 04:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395242#M812853</guid>
      <dc:creator>tripatirao</dc:creator>
      <dc:date>2017-10-09T04:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need to export only current and previous year data in excel through Macro</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395243#M812854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tripati,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay in my response. It's sad that the macro is not working properly in batch file.&amp;nbsp; Could you try debugging by adding "Msgbox" statement like below? Let me know what you see for each loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Sub Export&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;on error resume next&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Doc = ActiveDocument&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;'Assign&amp;nbsp; Inv_year field to FieldName, because the report generates for each Inv_year&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f = Doc.Variables("&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;vFisc_Year&lt;/STRONG&gt;")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f1 = Doc.Variables("vRegion")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET f2 = Doc.Variables("vReport_Type")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName = f.GetContent.STRING &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName1 = f1.GetContent.STRING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;FieldName2 = f2.GetContent.STRING&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field = Doc.Fields(FieldName).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For i=0 to Field.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit; color: #0000ff;"&gt;If Field.Item(i).Text = Trim(year(Now())) or Field.Item(i).Text = Trim(Year(Now())-1) then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;STRONG style="color: #ff0000;"&gt;Msgbox "Current year: " &amp;amp; &lt;/STRONG&gt;&lt;STRONG style="font-family: inherit; font-style: inherit; font-size: 13.3333px; color: #0000ff;"&gt;&lt;SPAN style="color: #ff0000;"&gt;Trim(year(Now())) &amp;amp; " Previous Year: " &amp;amp; &lt;/SPAN&gt;&lt;STRONG style="color: #ff0000; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Trim(Year(Now())-1)&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit; font-size: 13.3333px; color: #0000ff;"&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName).SELECT Field.Item(i).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName1).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field1= Doc.Fields(FieldName1).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For j=0 to Field1.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName1).SELECT Field1.Item(j).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Doc.Fields(FieldName2).Clear&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;SET Field2 = Doc.Fields(FieldName2).GetPossibleValues(100000)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;For k=0 to Field2.Count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Doc.Fields(FieldName2).SELECT Field2.Item(k).Text&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Doc.GetApplication.WaitForIdle&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; Path = "E:\STEEL\Data\Excel\PL_BS_Excel\" &amp;amp;Field.Item(i).Text &amp;amp;"_" &amp;amp;Field1.Item(j).Text &amp;amp;"_" &amp;amp;Field2.Item(k).Text &amp;amp;".xls"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&amp;nbsp; set obj = Doc.GetSheetObject("CH230")&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;obj.ExportBiff Path&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;End If&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #0000ff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;ActiveDocument.Save&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;Application.Quit&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;End Sub&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'Courier New'; color: #000000;"&gt;You should see message box like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/179192_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Oct 2017 02:02:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-export-only-current-and-previous-year-data-in-excel/m-p/1395243#M812854</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2017-10-11T02:02:06Z</dc:date>
    </item>
  </channel>
</rss>

