<?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 Run a script based on date from a log file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310572#M114669</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write a function for my loaders.&amp;nbsp; What I am trying to do is that I take a date from a log file and once that date from the log file is the same as the current date then to run the rest of the script but if it doesn’t meet the current date it will keep checking the log until the date equals the current date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function runLoader()&lt;BR /&gt;If date = Today then run the rest of the script&lt;BR /&gt;Else keep checking the date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I could go about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated,&lt;BR /&gt;Mckay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Aug 2011 14:56:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-08-30T14:56:08Z</dc:date>
    <item>
      <title>Run a script based on date from a log file</title>
      <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310572#M114669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to write a function for my loaders.&amp;nbsp; What I am trying to do is that I take a date from a log file and once that date from the log file is the same as the current date then to run the rest of the script but if it doesn’t meet the current date it will keep checking the log until the date equals the current date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function runLoader()&lt;BR /&gt;If date = Today then run the rest of the script&lt;BR /&gt;Else keep checking the date &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how I could go about this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is much appreciated,&lt;BR /&gt;Mckay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 14:56:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310572#M114669</guid>
      <dc:creator />
      <dc:date>2011-08-30T14:56:08Z</dc:date>
    </item>
    <item>
      <title>Run a script based on date from a log file</title>
      <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310573#M114670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the "date" field you are checking a field in the log file? So you only want rows where the date = today?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 15:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310573#M114670</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-08-30T15:50:27Z</dc:date>
    </item>
    <item>
      <title>Run a script based on date from a log file</title>
      <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310574#M114671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The log file contains a date once the job that generates the log has been completed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a loader to create QVD's but what I want to do is write a function so that it checks this log file and when the date in the log file is the same as the current date, the function stop and the rest of the script will run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you understand what I mean?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 15:55:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310574#M114671</guid>
      <dc:creator />
      <dc:date>2011-08-30T15:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: Run a script based on date from a log file</title>
      <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310575#M114672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I understand. This problem is typically solved by triggering the reload externally from the job that creates the file. However, it could be done in script as you've asked like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;DO until NoOfRows('logtable') &amp;gt; 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace Reading log file;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logtable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD Date, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&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; Message&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; logfile.txt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE Date = Today(1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Trace Sleeping...;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SLEEP 5000;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOOP&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://robwunderlich.com"&gt;http://robwunderlich.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2011 19:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310575#M114672</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-09-01T19:32:48Z</dc:date>
    </item>
    <item>
      <title>Run a script based on date from a log file</title>
      <link>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310576#M114673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Rob,&lt;BR /&gt;It's working perfectly- thanks alot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2011 10:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Run-a-script-based-on-date-from-a-log-file/m-p/310576#M114673</guid>
      <dc:creator />
      <dc:date>2011-09-05T10:12:35Z</dc:date>
    </item>
  </channel>
</rss>

