<?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 Create For Loop with MonthNames in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-For-Loop-with-MonthNames/m-p/1729264#M592732</link>
    <description>&lt;P&gt;We need to create For Loop Jan 20 to Oct 20 and Last 5 year date.&lt;/P&gt;&lt;P&gt;T1: //Jan 20&lt;BR /&gt;Load ID,&lt;BR /&gt;[Calendar Month]&lt;BR /&gt;Resident Table1 Where [Calendar Month]='Jan 20';&lt;/P&gt;&lt;P&gt;Join&lt;BR /&gt;Load&lt;BR /&gt;SaleDate,&lt;BR /&gt;ID&lt;BR /&gt;Resident table2 Where SaleDate&amp;gt;='01/01/2015' and SaleDate&amp;lt;='12/31/2019'; //Last five year&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;T1: // Feb 20&lt;BR /&gt;Load ID,&lt;BR /&gt;[Calendar Month]&lt;BR /&gt;Resident Table1 Where [Calendar Month]='Feb 20';&lt;/P&gt;&lt;P&gt;Join&lt;BR /&gt;Load&lt;BR /&gt;SaleDate,&lt;BR /&gt;ID&lt;BR /&gt;Resident table2 Where SaleDate&amp;gt;='02/01/2015' and SaleDate&amp;lt;='01/31/2020'; //Last five year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:17:38 GMT</pubDate>
    <dc:creator>karan_kn</dc:creator>
    <dc:date>2024-11-16T00:17:38Z</dc:date>
    <item>
      <title>Create For Loop with MonthNames</title>
      <link>https://community.qlik.com/t5/QlikView/Create-For-Loop-with-MonthNames/m-p/1729264#M592732</link>
      <description>&lt;P&gt;We need to create For Loop Jan 20 to Oct 20 and Last 5 year date.&lt;/P&gt;&lt;P&gt;T1: //Jan 20&lt;BR /&gt;Load ID,&lt;BR /&gt;[Calendar Month]&lt;BR /&gt;Resident Table1 Where [Calendar Month]='Jan 20';&lt;/P&gt;&lt;P&gt;Join&lt;BR /&gt;Load&lt;BR /&gt;SaleDate,&lt;BR /&gt;ID&lt;BR /&gt;Resident table2 Where SaleDate&amp;gt;='01/01/2015' and SaleDate&amp;lt;='12/31/2019'; //Last five year&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;T1: // Feb 20&lt;BR /&gt;Load ID,&lt;BR /&gt;[Calendar Month]&lt;BR /&gt;Resident Table1 Where [Calendar Month]='Feb 20';&lt;/P&gt;&lt;P&gt;Join&lt;BR /&gt;Load&lt;BR /&gt;SaleDate,&lt;BR /&gt;ID&lt;BR /&gt;Resident table2 Where SaleDate&amp;gt;='02/01/2015' and SaleDate&amp;lt;='01/31/2020'; //Last five year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:17:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-For-Loop-with-MonthNames/m-p/1729264#M592732</guid>
      <dc:creator>karan_kn</dc:creator>
      <dc:date>2024-11-16T00:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create For Loop with MonthNames</title>
      <link>https://community.qlik.com/t5/QlikView/Create-For-Loop-with-MonthNames/m-p/1729743#M592733</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Cal:
LOAD Date(MakeDate(2020,IterNo(),1),'MMM-YY') As CalMonth,
	 Date(AddMonths('1/1/2015',IterNo()-1)) As StartDate,
	 Date(AddMonths('12/31/2019',IterNo()-1)) As EndDate 	  
AutoGenerate 1
While IterNo()&amp;lt;=10;

For i = 1 To 10
	Let vCalMonth=Peek('CalMonth',$(i)-1);
	Let vStartDate=Peek('StartDate',$(i)-1);
	Let vEndDate=Peek('EndDate',$(i)-1);		
	TRACE vCalMonth=$(vCalMonth), vStartDate=$(vStartDate), vEndDate=$(vEndDate);
	T1: 
	Load ID,
	[Calendar Month]
	Resident Table1 Where [Calendar Month]='$(vCalMonth)';
	
	Join (T1)
	Load
	SaleDate,
	ID
	Resident table2 Where SaleDate&amp;gt;='$(vStartDate)' and SaleDate&amp;lt;='$(vEndDate)'; //Last five year
Next i

Drop Table Cal;&lt;/LI-CODE&gt;&lt;P&gt;Data in Cal:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV53.PNG" style="width: 179px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/37843iDF8ADFE66E700C67/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV53.PNG" alt="commQV53.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:01:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-For-Loop-with-MonthNames/m-p/1729743#M592733</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-07-22T03:01:22Z</dc:date>
    </item>
  </channel>
</rss>

