<?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 Last 3 years Data in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1550932#M744426</link>
    <description>&lt;P&gt;Thank you so much Prashanth it works&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42758"&gt;@PrashantSangle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try below logic&lt;BR /&gt;&lt;BR /&gt;Let vMaxYearMonth=num(Today());&lt;BR /&gt;Let vMinYearMonth=num(AddYears(Today(),-3));&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(AddMonths($(vMinYearMonth),IterNo() - 1),'YYYYMM') as TempDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While AddMonths($(vMinYearMonth),IterNo()-1) &amp;lt;= $(vMaxYearMonth)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 TO NoOfRows('TempCalendar') - 1&lt;BR /&gt;LET vYearMonth = peek('TempDate', $(i), 'TempCalendar');&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [lib://$(qvdPath)\abc_$(vYearMonth).qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Next i;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCalendar;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42758"&gt;@PrashantSangle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try below logic&lt;BR /&gt;&lt;BR /&gt;Let vMaxYearMonth=num(Today());&lt;BR /&gt;Let vMinYearMonth=num(AddYears(Today(),-3));&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(AddMonths($(vMinYearMonth),IterNo() - 1),'YYYYMM') as TempDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While AddMonths($(vMinYearMonth),IterNo()-1) &amp;lt;= $(vMaxYearMonth)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 TO NoOfRows('TempCalendar') - 1&lt;BR /&gt;LET vYearMonth = peek('TempDate', $(i), 'TempCalendar');&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [lib://$(qvdPath)\abc_$(vYearMonth).qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Next i;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCalendar;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you Prashanth it works&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 07:36:11 GMT</pubDate>
    <dc:creator>SatyaPaleti</dc:creator>
    <dc:date>2019-03-01T07:36:11Z</dc:date>
    <item>
      <title>Need Last 3 years Data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549594#M744423</link>
      <description>&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;I have a requirement. In a folder there are qvd's from 2011 January to 2019 February. I need to fetch only last 3 years qvd's only. How can we do this. Could some one can help me on this&lt;/P&gt;&lt;P&gt;abc_201101.qvd&lt;/P&gt;&lt;P&gt;abc_201102.qvd&lt;/P&gt;&lt;P&gt;abc_201103.qvd&lt;/P&gt;&lt;P&gt;abc_201104.qvd&lt;/P&gt;&lt;P&gt;abc_201105.qvd&lt;/P&gt;&lt;P&gt;abc_201106.qvd&lt;/P&gt;&lt;P&gt;abc_201107.qvd&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;abc_201902.qvd&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Satya&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:20:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549594#M744423</guid>
      <dc:creator>SatyaPaleti</dc:creator>
      <dc:date>2024-11-16T21:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last 3 years Data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549620#M744424</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try below logic&lt;BR /&gt;&lt;BR /&gt;Let vMaxYearMonth=num(Today());&lt;BR /&gt;Let vMinYearMonth=num(AddYears(Today(),-3));&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(AddMonths($(vMinYearMonth),IterNo() - 1),'YYYYMM') as TempDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While AddMonths($(vMinYearMonth),IterNo()-1) &amp;lt;= $(vMaxYearMonth)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 TO NoOfRows('TempCalendar') - 1&lt;BR /&gt;LET vYearMonth = peek('TempDate', $(i), 'TempCalendar');&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [lib://$(qvdPath)\abc_$(vYearMonth).qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Next i;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCalendar;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle</description>
      <pubDate>Wed, 27 Feb 2019 07:28:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549620#M744424</guid>
      <dc:creator>PrashantSangle</dc:creator>
      <dc:date>2019-02-27T07:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last 3 years Data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549654#M744425</link>
      <description>&lt;P&gt;I use this code pattern:&lt;/P&gt;&lt;PRE&gt;Let vMinDate = AddYears(Today() - 3);

// Creating the start point means that we can force concatenate, even if the field list changes
Data:
LOAD '' as Source Autogenerate 0;

For Each vFile in FileList('*.qvd')  // change to correct path to qvd files
	Let vDate = Date#(TextBetween(vFile, 'abc_', '.qvd'), 'yyyyMM');
	If vDate &amp;gt;= vMinDate Then
	
		Concatenate(Data)
		LOAD *,
			FileBaseName() as Source
		FROM [$(vFile)];
		
	End If
Next&lt;/PRE&gt;&lt;P&gt;This code will not throw an error if any files are missing, and they will concatenate into a single table even if the field lists change over time. Also, the Source field will have the lineage for the data rows.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Feb 2019 08:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1549654#M744425</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-02-27T08:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last 3 years Data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1550932#M744426</link>
      <description>&lt;P&gt;Thank you so much Prashanth it works&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42758"&gt;@PrashantSangle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try below logic&lt;BR /&gt;&lt;BR /&gt;Let vMaxYearMonth=num(Today());&lt;BR /&gt;Let vMinYearMonth=num(AddYears(Today(),-3));&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(AddMonths($(vMinYearMonth),IterNo() - 1),'YYYYMM') as TempDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While AddMonths($(vMinYearMonth),IterNo()-1) &amp;lt;= $(vMaxYearMonth)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 TO NoOfRows('TempCalendar') - 1&lt;BR /&gt;LET vYearMonth = peek('TempDate', $(i), 'TempCalendar');&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [lib://$(qvdPath)\abc_$(vYearMonth).qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Next i;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCalendar;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42758"&gt;@PrashantSangle&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try below logic&lt;BR /&gt;&lt;BR /&gt;Let vMaxYearMonth=num(Today());&lt;BR /&gt;Let vMinYearMonth=num(AddYears(Today(),-3));&lt;BR /&gt;&lt;BR /&gt;TempCalendar:&lt;BR /&gt;LOAD&lt;BR /&gt;Date(AddMonths($(vMinYearMonth),IterNo() - 1),'YYYYMM') as TempDate&lt;BR /&gt;AutoGenerate 1&lt;BR /&gt;While AddMonths($(vMinYearMonth),IterNo()-1) &amp;lt;= $(vMaxYearMonth)&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;FOR i = 0 TO NoOfRows('TempCalendar') - 1&lt;BR /&gt;LET vYearMonth = peek('TempDate', $(i), 'TempCalendar');&lt;BR /&gt;&lt;BR /&gt;Final:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [lib://$(qvdPath)\abc_$(vYearMonth).qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;Next i;&lt;BR /&gt;&lt;BR /&gt;Drop table TempCalendar;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Prashant Sangle&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you Prashanth it works&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 07:36:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1550932#M744426</guid>
      <dc:creator>SatyaPaleti</dc:creator>
      <dc:date>2019-03-01T07:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Need Last 3 years Data</title>
      <link>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1550934#M744427</link>
      <description>&lt;P&gt;Thank you Jhonty. It works well&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 07:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-Last-3-years-Data/m-p/1550934#M744427</guid>
      <dc:creator>SatyaPaleti</dc:creator>
      <dc:date>2019-03-01T07:37:04Z</dc:date>
    </item>
  </channel>
</rss>

