<?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: Selecting last working day issue ( Looping) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81642#M768908</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/1103506"&gt;Last working day Value&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this helps to you ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jun 2018 10:02:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-06-11T10:02:41Z</dc:date>
    <item>
      <title>Do..while - Picking last working day's file issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81641#M768907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are getting files in folder for Qlik. File Format is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC_20180609_231000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC_20180611_112000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC_20180612_123000&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC_20180613_101000&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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;From Monday to Friday, Files are generating, &amp;amp; we are fetching the latest file by using timestamp attached. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Our System is generating files on Working day also, though it is not having any data.&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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Our task is &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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if we are having 2 continues public holiday's, it should automatically pick last working day file by ignoring last 2 public holidays files.&amp;nbsp; &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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;For an example:&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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if today is 13-06-2018, and a public holiday for today and yesterday, It should ignore today's &amp;amp; previous day's file, and fetch 11-06-2018 files.&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;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;we are using master file for public holiday's but not getting any solutions.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;A href="https://community.qlik.com/qlik-users/218859" target="_blank"&gt;loveisfail&lt;/A&gt;‌ &lt;A href="https://community.qlik.com/qlik-users/4484" target="_blank"&gt;stevedark&lt;/A&gt;‌@&lt;BR /&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/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81641#M768907</guid>
      <dc:creator>amit_gupta</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting last working day issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81642#M768908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/1103506"&gt;Last working day Value&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this helps to you ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81642#M768908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-06-11T10:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting last working day issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81643#M768909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, It won't work in our scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because we are not having any static gap's between dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are using&amp;nbsp; Master table for date's &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81643#M768909</guid>
      <dc:creator>amit_gupta</dc:creator>
      <dc:date>2018-06-11T10:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting last working day issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81644#M768910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the logic of networkdays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Identify thew min date and max date available in the file file name, Also maintain an excel with all the public holidays in it.&lt;/P&gt;&lt;P&gt;then identify the networkdays(maxdate,mindate,holidays)&lt;/P&gt;&lt;P&gt;Based on the network days identify the date, and the lookup the file based on the date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this approach might help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;KC &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81644#M768910</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2018-06-11T10:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting last working day issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81645#M768911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess, you would need: &lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/lastworkdate.htm" title="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/lastworkdate.htm"&gt;lastworkdate()&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:12:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81645#M768911</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2018-06-11T10:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting last working day issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81646#M768912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks mate, I am not playing with charts. I am writing loop in script for latest file excluding the Public holiday and Weekends. So, I am maintaining the public holidays in spreadsheet. And, This is the script finally i have enclosed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET &lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff00ff;"&gt;VAUMax_Day&lt;/SPAN&gt; = DATE(PEEK(Max(date#(left(right(FileName() ,19),15),'YYYYMMDD_hhmmss')),0,'DATETIME'),'YYYYMMDD_hhmmss');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Set a = 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Do while a&amp;lt;=7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Holiday:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#("AU Holiday",'DD-MM-YYYY'),'DD-MM-YYYY') as [AU Holiday],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Flag&lt;/P&gt;&lt;P&gt;FROM AU Holiday.csv&lt;/P&gt;&lt;P&gt;(txt, utf8, embedded labels, delimiter is ',', msq) Where [AU Holiday]='$(&lt;STRONG style="color: #ff00ff;"&gt;VAUMax_Day&lt;/STRONG&gt;)'; &lt;STRONG style="color: #339966;"&gt;//This returns as expected. Only problem here is i am not moving backward if previous date is public holiday. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;LET&amp;nbsp; b= NoOfRows('Holiday');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;if b&amp;gt;0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;LET VAUMax_Day=DATE(PEEK('Max_Day',0,'DATETIME'),'DD-MM-YYYY')-1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;endif&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Let a=a+1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;Loop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conclusion - My use case is If i have files in list like above(Original thread). From there i am pulling dates using &lt;STRONG style="text-decoration: underline;"&gt;FileName()&lt;/STRONG&gt; after that i am creating max date and min date. But, When i tried above loop the variable it self not loading &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;Does it make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; - Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:49:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81646#M768912</guid>
      <dc:creator>amit_gupta</dc:creator>
      <dc:date>2018-06-11T10:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Do..while - Picking last working day's file issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81647#M768913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked if your variable declaration statement is actually working? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LET VAUMax_Day = DATE(PEEK(Max(date#(left(right(FileName() ,19),15),'YYYYMMDD_hhmmss')),0,'DATETIME'),'YYYYMMDD_hhmmss');&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/confused.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 11:03:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81647#M768913</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2018-06-11T11:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Do..while - Picking last working day's file issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81648#M768914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FILEINFO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date#(left(right(FileName() ,19),15),'YYYYMMDD_hhmmss') as &lt;SPAN style="color: #ff0000;"&gt;FullDate&lt;/SPAN&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date#(left(right(FileName() ,19),8),'YYYYMMDD') as Date_M&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM ABC_*.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(txt, utf8, embedded labels, delimiter is ',', msq);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;DATETIME:&lt;/P&gt;&lt;P&gt;lOAD&lt;/P&gt;&lt;P&gt;MAX(&lt;STRONG style="color: #ff0000; font-size: 13.3333px;"&gt;FullDate&lt;/STRONG&gt;) AS &lt;SPAN style="color: #ff00ff;"&gt;Max_Date&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;MAX(Date_M) AS Max_Day&lt;/P&gt;&lt;P&gt;Resident FILEINFO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET &lt;SPAN style="color: #0000ff;"&gt;vAUMaxDate&lt;/SPAN&gt;=DATE(PEEK('&lt;SPAN style="color: #ff00ff; font-size: 13.3333px;"&gt;Max_Date&lt;/SPAN&gt;',0,'DATETIME'),'YYYYMMDD_hhmmss');&lt;/P&gt;&lt;P&gt;LET VAUMax_Day=DATE(PEEK('Max_Day',0,'DATETIME'),'DD-MM-YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Holiday:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(Date#("AU Holiday",'DD-MM-YYYY'),'DD-MM-YYYY') as [AU Holiday],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Flag&lt;/P&gt;&lt;P&gt;FROM [lib://Connection/AU Holiday.csv]&lt;/P&gt;&lt;P&gt;(txt, utf8, embedded labels, delimiter is ',', msq) Where [AU Holiday]='$(&lt;SPAN style="color: #0000ff; font-size: 13.3333px;"&gt;vAUMaxDate&lt;/SPAN&gt;)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is loading till one day, But i want to make it as Loop for all iteration &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2018 11:13:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81648#M768914</guid>
      <dc:creator>amit_gupta</dc:creator>
      <dc:date>2018-06-11T11:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Do..while - Picking last working day's file issue ( Looping)</title>
      <link>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81649#M768915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for recommending me, Can you try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET vFILEPATH="lib://Dump";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FILEINFO:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FileName() as File_name,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date#(left(right(FileName() ,19),15),'YYYYMMDD_hhmmss') as FullDate,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;date#(left(right(FileName() ,19),8),'YYYYMMDD') as Date_M&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM $(vFILEPATH)\&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;ABC&lt;/SPAN&gt;_*.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(txt, utf8, embedded labels, delimiter is ',', msq);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATETIME:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;lOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAX(FullDate) AS Max_Date,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MAX(Date_M) AS Max_Day &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident FILEINFO;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vAUMaxDate=DATE(PEEK('Max_Date',0,'DATETIME'),'YYYYMMDD_hhmmss');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET VAUMax_Day=Num(DATE(PEEK('Max_Day',0,'DATETIME'),'YYYYMMDD'));&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Previous_Date:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;max(date#(FullDate,'YYYYMMDD_hhmmss')) as YESTERDAYTIME&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident FILEINFO WHERE num(Date_M)&amp;lt;'$(VAUMax_Day)';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET vAUPrev_Date = DATE(PEEK('YESTERDAYTIME',0,'Previous_Date'),'YYYYMMDD_hhmmss');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM $(vFILEPATH)\&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;ABC&lt;/SPAN&gt;_$(vAUMaxDate)*.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(txt, utf8, embedded labels, delimiter is ',', msq);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #ff0000;"&gt;SET @MyDate_Real = "=Date('$(VAUMax_Day)')";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="color: #0000ff;"&gt;Trace '$(@MyDate_Real)';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;SET @MyDate= If(WeekDay('$(@MyDate_Real)') = 'Sun', Date('$(@MyDate_Real)'-2,'DD/MM/YYYY'),&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(WeekDay('$(@MyDate_Real)') = 'Sat', Date('$(@MyDate_Real)'-1,'DD/MM/YYYY'), &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date('$(@MyDate_Real)','DD/MM/YYYY')));&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="color: #0000ff;"&gt;Trace '$(@MyDate)';&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Holiday_List:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Holiday List" as Holiday&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;FROM $(&lt;STRONG style="font-size: 13.3333px;"&gt;vFILEPATH)\&lt;/STRONG&gt;Public Holidays.csv&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;(txt, codepage is 28591, embedded labels, delimiter is '\t', msq);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Right Join (Holiday_List)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Load Holiday, COUNT(Holiday) as Holiday_Flag &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Resident Holiday_List &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;where Holiday='$(@MyDate)'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;Group By Holiday;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;LET @Holiday_Flag = Peek('Holiday_Flag',0,'Holiday_List');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG style="color: #3366ff;"&gt;if '$(@Holiday_Flag)' &amp;gt; 0 Then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do while '$(@Holiday_Flag)' &amp;gt;=1 &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;set @MyDate=Date('$(@MyDate)'-1,'DD/MM/YYYY');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;Right Join (Holiday_List)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Load Holiday, COUNT(Holiday) as Holiday_Flag &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resident Holiday_List &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where Holiday='$(@MyDate)'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Group By Holiday;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LET @Holiday_Flag = Peek('Holiday_Flag',0,'Holiday_List');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #3366ff;"&gt;End If&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt;Note&lt;/SPAN&gt; - Let me know if you need working file in SQL Server with image of format in CSV?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Does it helps?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2018 05:40:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-while-Picking-last-working-day-s-file-issue-Looping/m-p/81649#M768915</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-06-18T05:40:30Z</dc:date>
    </item>
  </channel>
</rss>

