<?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: Waiting for data source to update data while refresh is running in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443938#M695652</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your assumption is correct - if the database is updated, it doesn't go through the do while logic at all.&amp;nbsp; Introducing the MatchValues variable is working so I'll close the issue.&amp;nbsp; I'd still be interested to know why the original logic didn't work.&amp;nbsp; Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 14:24:50 GMT</pubDate>
    <dc:creator>brennanbd</dc:creator>
    <dc:date>2013-06-06T14:24:50Z</dc:date>
    <item>
      <title>Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443932#M695646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am in an iSeries data environment where I'm trying to wait for batch jobs to finish on the server before attempting to load the data into Qlikview.&amp;nbsp; I have this solution working fine in a non-Qlikview environment, and I'm attempting to replicate this report in Qlikview.&amp;nbsp; Here is how it's supposed to work:&lt;/P&gt;&lt;P&gt;1. Check the system for the max load date in the file.&lt;/P&gt;&lt;P&gt;2. If the max load date is equal to yesterday, proceed with the load (data is ready).&lt;/P&gt;&lt;P&gt;3. If the max load date is not equal to yesterday, wait 15 minutes and try step #2 again.&amp;nbsp; &lt;/P&gt;&lt;P&gt;4. Repeat step #3 five times, then abort the process if no data is available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code below works correctly if I don't try to change the RECORDDT while it's in the do while loop.&amp;nbsp; I've used the Debug process and seen that if I update the RecordDt on the back end system while the do while is running, and the vRecordDt value changes to be the same as the VYesterdayAS400 variable, the loop continues running until it gets to vCounter=5.&amp;nbsp; The whole point of waiting is to see if the data has loaded on the back end system and then proceeding with the load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13704545401548128" jivemacro_uid="_13704545401548128"&gt;&lt;P&gt;LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT MAX(YDAYDT) AS RECORDDT&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; Data.File1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vYesterdayAS400 = date(now()-1,'1YYMMDD');&lt;/P&gt;&lt;P&gt;Let vCounter = 1;&lt;/P&gt;&lt;P&gt;Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do while ($(vRecordDt) &amp;lt;&amp;gt; $(vYesterdayAS400)) and (vCounter &amp;lt; 5)&lt;/P&gt;&lt;P&gt;&amp;nbsp; sleep 2000; // ideally sleep for 15 minutes which is 900000, but in testing sleep for 2 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop field RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(YDAYDT) AS RECORDDT FROM &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Data.File1&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vCounter = vCounter + 1;&lt;/P&gt;&lt;P&gt;loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;...do the rest if the data is there...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something obvious?&amp;nbsp; Is there a better way to accomplish my goal?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Billy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 18:02:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443932#M695646</guid>
      <dc:creator>brennanbd</dc:creator>
      <dc:date>2013-06-05T18:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443933#M695647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;do while (vRecordDt &amp;lt;&amp;gt; vYesterdayAS400) and (vCounter &amp;lt; 5)&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and double check the variables and their format while executing the script (e.g. using the debugger and / or TRACE statements).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 20:04:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443933#M695647</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-05T20:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443934#M695648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried using a comparison without the $(v...) and it doesn't work.&amp;nbsp; I've used debugging many times trying to troubleshoot this issue, and the variables are coming through with expected values.&amp;nbsp; So I'm still stuck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Billy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 20:17:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443934#M695648</guid>
      <dc:creator>brennanbd</dc:creator>
      <dc:date>2013-06-05T20:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443935#M695649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And your AS400 date is really formated with a leading '1' (like you formated your yesterday's date)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you post your execution log (add TRACE statements if needed to show the variable values)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also try adding table name labels to your table loads and using these table names in your peek() functions as third argument.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 20:39:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443935#M695649</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-05T20:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443936#M695650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have figured out a solution, but I'll first post information related to the original code set because in theory it should work.&amp;nbsp; Stefan, yes the date format is correct - the AS400 we have uses a CYYMMDD value where C is 0 for 19, 1 for 20, 2 for 21, and so on.&amp;nbsp; We're good until the year 3000, but by then I won't care &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;Here is my original code with trace statements added:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13704673589822141" jivemacro_uid="_13704673589822141"&gt;&lt;P&gt;trace Step 1 - Load initial source data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT MAX(YDAYDT) AS RECORDDT&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; Database.File1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vCounter = 1;&lt;/P&gt;&lt;P&gt;Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace Step 2 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;trace Step 3 - vRecordDt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;trace Step 4 - About to enter do while loop;&lt;/P&gt;&lt;P&gt;do while ($(vRecordDt) &amp;lt;&amp;gt; $(vYesterdayAS400)) and (vCounter &amp;lt; 5)&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 5 - Inside do while loop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sleep 2000; // 900000 sleep for 15 minutes waiting for data to be ready&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop field RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 6 - Reloading data source to see if updated;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(YDAYDT) AS RECORDDT FROM Database.File1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vCounter = vCounter + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 7 - new Recorddt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 8 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 9 - vCounter=$(vCounter);&lt;/P&gt;&lt;P&gt;loop&lt;/P&gt;&lt;P&gt;trace Step 11 - Outside do while loop;&lt;/P&gt;&lt;P&gt;trace Step 12 - vCounter=$(vCounter);&lt;/P&gt;&lt;P&gt;trace Step 13 - Recorddt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;trace Step 14 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the execution log using Debug mode:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connecting to dataconnection&lt;/P&gt;&lt;P&gt;Connected&lt;/P&gt;&lt;P&gt;Step 1 - Load initial source data&lt;/P&gt;&lt;P&gt;File1 lines fetched&lt;/P&gt;&lt;P&gt;Step 2 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 3 - vRecordDt value=1130603&lt;/P&gt;&lt;P&gt;Step 4 - About to enter do while loop&lt;/P&gt;&lt;P&gt;Step 5 - Inside do while loop&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;------ I changed the data in the data source so the Recorddt value = vYesterdayAS400 value ------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step 6 - Reloading data source to see if updated&lt;/P&gt;&lt;P&gt;File1 lines fetched&lt;/P&gt;&lt;P&gt;Step 7 - new Recorddt value=&lt;SPAN style="color: #ff0000;"&gt;1130604&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step 8 - vYesterdayAS400 value=&lt;SPAN style="color: #ff0000;"&gt;1130604&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step 9 - vCounter=2&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;------ Should have exited the do while loop here, but it didn't ---------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Step 5 - Inside do while loop&lt;/P&gt;&lt;P&gt;Step 6 - Reloading data source to see if updated&lt;/P&gt;&lt;P&gt;File1 1 lines fetched&lt;/P&gt;&lt;P&gt;Step 7 - new Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 8 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 9 - vCounter=3&lt;/P&gt;&lt;P&gt;Step 5 - Inside do while loop&lt;/P&gt;&lt;P&gt;Step 6 - Reloading data source to see if updated&lt;/P&gt;&lt;P&gt;File1 1 lines fetched&lt;/P&gt;&lt;P&gt;Step 7 - new Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 8 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 9 - vCounter=4&lt;/P&gt;&lt;P&gt;Step 5 - Inside do while loop&lt;/P&gt;&lt;P&gt;Step 6 - Reloading data source to see if updated&lt;/P&gt;&lt;P&gt;File1 1 lines fetched&lt;/P&gt;&lt;P&gt;Step 7 - new Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 8 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 9 - vCounter=5&lt;/P&gt;&lt;P&gt;Step 11 - Outside do while loop&lt;/P&gt;&lt;P&gt;Step 12 - vCounter=5&lt;/P&gt;&lt;P&gt;Step 13 - Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 14 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;...additional data steps&lt;/P&gt;&lt;P&gt;--- Script Finished --- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THIS is the code that actually works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13704679336097603" jivemacro_uid="_13704679336097603"&gt;&lt;P&gt;LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;SQL &lt;/P&gt;&lt;P&gt;SELECT MAX(YDAYDT) AS RECORDDT&lt;/P&gt;&lt;P&gt;FROM&amp;nbsp; database.file1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Let vCounter = 1;&lt;/P&gt;&lt;P&gt;Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trace Step 2 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;trace Step 3 - vRecordDt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;If ($(vRecordDt) = $(vYesterdayAS400)) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Let vMatchValues = 'Y';&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Let vMatchValues = 'N';&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;trace show vmatchvalues = $(vMatchValues);&lt;/P&gt;&lt;P&gt;trace Step 4 - About to enter do while loop;&lt;/P&gt;&lt;P&gt;do while vMatchValues='N' and (vCounter &amp;lt; 5)&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 5 - Inside do while loop;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sleep 2000; // 900000 sleep for 15 minutes waiting for data to be ready&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop field RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 6 - Reloading data source to see if updated;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD RECORDDT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; SQL SELECT MAX(YDAYDT) AS RECORDDT FROM &lt;SPAN style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;database.file1&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vRecordDt = peek('RECORDDT');&lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vCounter = vCounter + 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 7 - new Recorddt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 8 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace Step 9 - vCounter=$(vCounter);&lt;/P&gt;&lt;P&gt;&amp;nbsp; If ($(vRecordDt) = $(vYesterdayAS400)) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vMatchValues = 'Y';&lt;/P&gt;&lt;P&gt;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Let vMatchValues = 'N';&lt;/P&gt;&lt;P&gt;&amp;nbsp; endif&lt;/P&gt;&lt;P&gt;&amp;nbsp; trace show vmatchvalues = $(vMatchValues);&lt;/P&gt;&lt;P&gt;loop&lt;/P&gt;&lt;P&gt;trace Step 11 - Outside do while loop;&lt;/P&gt;&lt;P&gt;trace Step 12 - vCounter=$(vCounter);&lt;/P&gt;&lt;P&gt;trace Step 13 - Recorddt value=$(vRecordDt);&lt;/P&gt;&lt;P&gt;trace Step 14 - vYesterdayAS400 value=$(vYesterdayAS400);&lt;/P&gt;&lt;P&gt;...additional steps...&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And trace for the solution:&lt;/P&gt;&lt;P&gt;Connecting to dataconnection&lt;/P&gt;&lt;P&gt;Connected&lt;/P&gt;&lt;P&gt;Step 1 - Load initial source data&lt;/P&gt;&lt;P&gt;File1 1 lines fetched&lt;/P&gt;&lt;P&gt;Step 2 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 3 - vRecordDt value=1130603&lt;/P&gt;&lt;P&gt;show vmatchvalues = N&lt;/P&gt;&lt;P&gt;Step 4 - About to enter do while loop&lt;/P&gt;&lt;P&gt;Step 5 - Inside do while loop&lt;/P&gt;&lt;P&gt;Step 6 - Reloading data source to see if updated&lt;/P&gt;&lt;P&gt;File1 1 lines fetched&lt;/P&gt;&lt;P&gt;Step 7 - new Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 8 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;Step 9 - vCounter=2&lt;/P&gt;&lt;P&gt;show vmatchvalues = Y&lt;/P&gt;&lt;P&gt;Step 11 - Outside do while loop&lt;/P&gt;&lt;P&gt;Step 12 - vCounter=2&lt;/P&gt;&lt;P&gt;Step 13 - Recorddt value=1130604&lt;/P&gt;&lt;P&gt;Step 14 - vYesterdayAS400 value=1130604&lt;/P&gt;&lt;P&gt;...additional data steps...&lt;/P&gt;&lt;P&gt;--- Script Finished --- &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I still have the question as to why the original DO WHILE with the $(variable) statements didn't work??&amp;nbsp; I'm glad I have a workable solution, but it's going to bother me.&amp;nbsp; Is it a Qlikview bug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jun 2013 21:37:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443936#M695650</guid>
      <dc:creator>brennanbd</dc:creator>
      <dc:date>2013-06-05T21:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443937#M695651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would guess that this will break your logic also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do while $(vMatchValues) ='N' and (vCounter &amp;lt; 5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because I think the dollar sign expansion will be only executed once for the DO WHILE statement, not for every loop run. So it will be interpreted as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do while 'N'='N' and (vCounter &amp;lt; 5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for every loop run, if your initial comparison returns false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have assumed that this is also causing the initial issue, but since you already tried to replace the dollar sign expansion with just the variable name (as indicated in my first post), I don't have a clue right now.&lt;/P&gt;&lt;P&gt;If my assumption is correct, running your script with the data base being up to date should result in no wait time at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 12:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443937#M695651</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-06-06T12:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Waiting for data source to update data while refresh is running</title>
      <link>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443938#M695652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your assumption is correct - if the database is updated, it doesn't go through the do while logic at all.&amp;nbsp; Introducing the MatchValues variable is working so I'll close the issue.&amp;nbsp; I'd still be interested to know why the original logic didn't work.&amp;nbsp; Thanks again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 14:24:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Waiting-for-data-source-to-update-data-while-refresh-is-running/m-p/443938#M695652</guid>
      <dc:creator>brennanbd</dc:creator>
      <dc:date>2013-06-06T14:24:50Z</dc:date>
    </item>
  </channel>
</rss>

