<?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: retrieving only last 3 weeks data while extract in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54071#M9006</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 achieve this with:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOG_TABLE:&lt;BR /&gt;LOAD *,&lt;BR /&gt;if(Date(Date#(SubField(SubField(Id_log,'_',2),'.',1),'YYYY-MM-DD'),'DD/MM/YYYY')&amp;gt;=(today()-21),1,0) as Flag&lt;BR /&gt; INLINE [&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id_log&lt;BR /&gt;1a_2018-05-04.log&lt;BR /&gt;2b_2018-04-30.log&lt;BR /&gt;3c_2018-04-28.log&lt;BR /&gt;4d_2017-02-04.log&lt;BR /&gt;5e_2017-01-04.log&lt;BR /&gt;6f_2016-03-04.log&lt;BR /&gt;7g_2016-02-04.log&lt;BR /&gt;8d_2016-01-04.log&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FINAL_LOG_TABLE:&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT LOG_TABLE&lt;BR /&gt;where Flag=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table LOG_TABLE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2018 09:01:35 GMT</pubDate>
    <dc:creator>sergio0592</dc:creator>
    <dc:date>2018-05-04T09:01:35Z</dc:date>
    <item>
      <title>retrieving only last 3 weeks data while extract</title>
      <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54069#M9004</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;in my extract folder which have log files from 2016 to 2018&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;example in the folder i have file name as listed below &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1a_2018-05-04.log&lt;/P&gt;&lt;P&gt;2b_&lt;SPAN style="font-size: 13.3333px;"&gt;2018-04-30.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;3c_&lt;SPAN style="font-size: 13.3333px;"&gt;2018-04-28.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;4d&lt;SPAN style="font-size: 13.3333px;"&gt;_2017-02-04.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;5e&lt;SPAN style="font-size: 13.3333px;"&gt;_2017-01-04.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;6f&lt;SPAN style="font-size: 13.3333px;"&gt;_2016-03-04.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;7g&lt;SPAN style="font-size: 13.3333px;"&gt;_2016-02-04.log&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;8d_2016-01-04.log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now when i want to load the data in the script i dont want to take all the files from folder i need only last 3 weeks files to be retrived in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example current date - 3 weeks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in script level how to achieve this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 08:17:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54069#M9004</guid>
      <dc:creator>manoranjan_d</dc:creator>
      <dc:date>2018-05-04T08:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving only last 3 weeks data while extract</title>
      <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54070#M9005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vTestDate = Today() - 21;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;For Each vFile in FileList('$(path)\*.log')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vDate = Date#(Mid(SubField(vFile, '\', -1), 4, 10), 'yyyy-MM-dd');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If vDate &amp;gt;= vTestDate Then&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD .... &amp;lt;load statement here&amp;gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Next&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assumes same structure in all files and that you have a path variable with the file path to the log files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 08:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54070#M9005</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2018-05-04T08:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving only last 3 weeks data while extract</title>
      <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54071#M9006</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 achieve this with:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;LOG_TABLE:&lt;BR /&gt;LOAD *,&lt;BR /&gt;if(Date(Date#(SubField(SubField(Id_log,'_',2),'.',1),'YYYY-MM-DD'),'DD/MM/YYYY')&amp;gt;=(today()-21),1,0) as Flag&lt;BR /&gt; INLINE [&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id_log&lt;BR /&gt;1a_2018-05-04.log&lt;BR /&gt;2b_2018-04-30.log&lt;BR /&gt;3c_2018-04-28.log&lt;BR /&gt;4d_2017-02-04.log&lt;BR /&gt;5e_2017-01-04.log&lt;BR /&gt;6f_2016-03-04.log&lt;BR /&gt;7g_2016-02-04.log&lt;BR /&gt;8d_2016-01-04.log&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FINAL_LOG_TABLE:&lt;BR /&gt;LOAD *&lt;BR /&gt;RESIDENT LOG_TABLE&lt;BR /&gt;where Flag=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drop table LOG_TABLE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 09:01:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54071#M9006</guid>
      <dc:creator>sergio0592</dc:creator>
      <dc:date>2018-05-04T09:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving only last 3 weeks data while extract</title>
      <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54072#M9007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jon,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;my&amp;nbsp; file name format is &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;name1_name2_2018-04-28.log&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so&amp;nbsp; how to retrive the date in the varibale of vDate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 09:27:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54072#M9007</guid>
      <dc:creator>manoranjan_d</dc:creator>
      <dc:date>2018-05-04T09:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: retrieving only last 3 weeks data while extract</title>
      <link>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54073#M9008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe try with:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vDate = Date#(&lt;/EM&gt;&lt;EM&gt;SubField(SubField(v_File,'_',3),'.',1),'yyyy-MM-dd');&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2018 09:35:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/retrieving-only-last-3-weeks-data-while-extract/m-p/54073#M9008</guid>
      <dc:creator>sergio0592</dc:creator>
      <dc:date>2018-05-04T09:35:06Z</dc:date>
    </item>
  </channel>
</rss>

