<?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: Last Two Month Names in Load Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954970#M328261</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use below script - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vEndingMonth = Date(MakeDate(2015,09,01),'MMM YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vThreemonths = vEndingMonth &amp;amp;'_'&amp;amp; Date(AddMonths(vEndingMonth,-1),'MMM YYYY') &amp;amp;'_' &amp;amp;Date(AddMonths(vEndingMonth,-2),'MMM YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month:&lt;/P&gt;&lt;P&gt;Load subField('$(vThreemonths)','_') as Date Autogenerate(1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Sep 2015 04:12:24 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2015-09-29T04:12:24Z</dc:date>
    <item>
      <title>Last Two Month Names in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954968#M328259</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;I want to load last two months data into my application. I just want to create a table which should stores the last two month names in below format. Say for example I have a variable called "&lt;STRONG&gt;vEndingMonth&lt;/STRONG&gt;" and the month name stored as "&lt;STRONG&gt;Sep 2015&lt;/STRONG&gt;". I want to create a table (by using the above variable) which should contains below month names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sep 2015&lt;/P&gt;&lt;P&gt;Aug 2015&lt;/P&gt;&lt;P&gt;July 2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll use the above table when loading QVD's. I wish to use direct file names in my load script &lt;SPAN style="font-size: 13.3333px;"&gt;instead of looping through all QVD's. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 03:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954968#M328259</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-09-29T03:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Last Two Month Names in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954969#M328260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tamil Nagaraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple ways to achieve this. Let me suggest one way..you can create two columns like prev_month, prev_month-1 and with addmonths() function you can substract -1 for previous month and -2 for previous to previous month. with Date# function you can get the desired format..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Sreeni&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 03:16:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954969#M328260</guid>
      <dc:creator>SreeniJD</dc:creator>
      <dc:date>2015-09-29T03:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Last Two Month Names in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954970#M328261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use below script - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vEndingMonth = Date(MakeDate(2015,09,01),'MMM YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vThreemonths = vEndingMonth &amp;amp;'_'&amp;amp; Date(AddMonths(vEndingMonth,-1),'MMM YYYY') &amp;amp;'_' &amp;amp;Date(AddMonths(vEndingMonth,-2),'MMM YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Month:&lt;/P&gt;&lt;P&gt;Load subField('$(vThreemonths)','_') as Date Autogenerate(1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 04:12:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954970#M328261</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2015-09-29T04:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Last Two Month Names in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954971#M328262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi Jd Sreeni,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion and it's working fine. But, we need to fetch data from three columns. My expectation is all values in a single field and single table. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hi DigVijay Singh,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just modified the your code a bit. It's not taking previous months due to data format problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14435023274582465" jivemacro_uid="_14435023274582465"&gt;
&lt;P style="font-size: 13.3333px;"&gt;Let vThreemonths = '$(vEndingMonth)' &amp;amp;'_'&amp;amp; MonthName(Addmonths(Date#('$(vEndingMonth)','MMM YYYY'),-1)) &amp;amp;'_' &amp;amp;MonthName(Addmonths(Date#('$(vEndingMonth)','MMM YYYY'),-2));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;Month:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="font-size: 13.3333px;"&gt;Load subField('$(vThreemonths)','_') as Date Autogenerate(1);&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to both of you. Have a nice day.&lt;IMG __jive_id="100281" alt="cheerful-cat-face-smiley-emoticon.gif" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/100281_cheerful-cat-face-smiley-emoticon.gif" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 04:53:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954971#M328262</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-09-29T04:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Last Two Month Names in Load Script</title>
      <link>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954972#M328263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Just tried this and working like expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14435052447964618 jive_text_macro" jivemacro_uid="_14435052447964618"&gt;
&lt;P&gt;FOR i=-2 to 0 Step 1&lt;/P&gt;
&lt;P&gt;MonthTemp:&lt;/P&gt;
&lt;P&gt;LOAD MonthName(Addmonths(Date#('$(vEndingMonth)','MMM YYYY'),$(i))) as Month AutoGenerate(1);&lt;/P&gt;
&lt;P&gt;NEXT&lt;/P&gt;


&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Sep 2015 05:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Last-Two-Month-Names-in-Load-Script/m-p/954972#M328263</guid>
      <dc:creator>tamilarasu</dc:creator>
      <dc:date>2015-09-29T05:40:52Z</dc:date>
    </item>
  </channel>
</rss>

