<?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: Update edited/new QVD records from DB in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449974#M486040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="cid:image001.png@01CE23DA.E560EBA0"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Mar 2013 11:33:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-03-18T11:33:54Z</dc:date>
    <item>
      <title>Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449971#M486037</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;I have been trying to update my QVD with new or edited records on the DB unsuccessfully.&amp;nbsp; I have been using this script.&amp;nbsp; It siimply does not fetch and update the QVD with new or edited records.&amp;nbsp; Please help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Fetch my exitsing data in my QVD&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD * FROM &lt;C&gt; (QVD); &lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Determine the Max (RL_EDIT_DATE) and store as vMaxEditDate&lt;/P&gt;&lt;P&gt;RL_MaxDate:&lt;/P&gt;&lt;P&gt;LOAD MAX(RL_EDIT_DATE)as MaxEditDate&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA; &lt;/P&gt;&lt;P&gt;let vMaxEditDate = Peek('MaxEditDate',0,'RL_MaxDate');&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Determine the Max(RL_EDIT_TIME) from the records which have theMax(RL_ADD_DATE) and store as vMaxEditTime&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as RL_EDIT_TIME&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (QVD)&lt;/C&gt;&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE = $(vMaxEditDate);&lt;/P&gt;&lt;P&gt;RL_MaxTime:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as MaxEditTime&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA;&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Peek('MaxEditTime',0,'RL_MaxTime');&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Not that I have the Max(RL_EDIT_DATE) and Max(RL_EDIT_TIME, I can use them to query the DB to return newer edited records.&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO PRISMHC (XUserId is XVRGBZVMBDZeGXRNZTbA, XPassword is EAHfPZVMBDZeGXRNZLfB);&lt;/P&gt;&lt;P&gt;RL_New:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.RL&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE &amp;gt; $(vMaxEditDate)&lt;/P&gt;&lt;P&gt;and RL_EDIT_TIME &amp;gt; $(vMaxEditTime);&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD * FROM C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD (QVD)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (ID);&lt;/P&gt;&lt;P&gt;STORE RL_New INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD;&lt;/P&gt;&lt;P&gt;DROP TABLES RL_MaxDate,RL_MaxTime,RL_New;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 10:49:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449971#M486037</guid>
      <dc:creator />
      <dc:date>2013-03-18T10:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449972#M486038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Try to give dates in quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;WHERE RL_EDIT_DATE = '$(vMaxEditDate)';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;make change in other conditions too...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sushil&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449972#M486038</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-03-18T11:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449973#M486039</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 can see a couple of changes to get this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, change the Peek expressions so that the variables contain correctly formatted date and time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;let vMaxEditDate = Date(Peek('MaxEditDate',0,'RL_MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Time(Peek('MaxEditTime',0,'RL_MaxTime'), 'hh:mm:ss');&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Use the correct date and time formats for your database. You can test this by manually submitting the SQL expression using a SQL front end like SQLMS or Toad)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then your Where condition looks suspect. I suggest that you use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.RL&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE &amp;gt; '$(vMaxEditDate)' Or (RL_EDIT_DATE = '$(vMaxEditDate)' And RL_EDIT_TIME &amp;gt; '$(vMaxEditTime)')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:23:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449973#M486039</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-03-18T11:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449974#M486040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="cid:image001.png@01CE23DA.E560EBA0"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449974#M486040</guid>
      <dc:creator />
      <dc:date>2013-03-18T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449975#M486041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sushil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Must I also place the RL_EDIT_TIME = '$(vMaxEditTime)' inside quotes? The RL_EDIT_TIME field is type INT and not a TIME field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:42:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449975#M486041</guid>
      <dc:creator />
      <dc:date>2013-03-18T11:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449976#M486042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks tried your changes and got this…note the RL_EDIT_TIME field is actually INT type, e.g.: 54501 would be 05:45:01 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:42:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449976#M486042</guid>
      <dc:creator />
      <dc:date>2013-03-18T11:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449977#M486043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys (Thanks for the prompt responces)&lt;/P&gt;&lt;P&gt;I have used this as the RL_EDIT_TIME is int&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'RL_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was the result.&amp;nbsp; Any ideas whats wrong with the syntax near 'CONCATENATE'?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" height="126" src="https://community.qlik.com/" style="max-width: 1200px; max-height: 900px;" width="484" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449977#M486043</guid>
      <dc:creator />
      <dc:date>2013-03-18T11:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449978#M486044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys (Thanks for the prompt responces)&lt;/P&gt;&lt;P&gt;I have used this as the RL_EDIT_TIME is int&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'RL_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was the result.&amp;nbsp; Any ideas whats wrong with the syntax near 'CONCATENATE'?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Error.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/35113_Error.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jiveImage" height="126" src="https://community.qlik.com/message/323099/" style="max-width: 1200px; max-height: 900px;" width="484" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449978#M486044</guid>
      <dc:creator />
      <dc:date>2013-03-18T11:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449979#M486045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please upload a sample data and application.. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449979#M486045</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-03-18T11:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449980#M486046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am afraid I cannot see anything in the box/image.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:51:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449980#M486046</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-03-18T11:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449981#M486047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached Pic is not visible??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:54:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449981#M486047</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-03-18T11:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449982#M486048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its works, I had put wrong refferences to RL_ instead of the QM_.....thanks you so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2013 12:02:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449982#M486048</guid>
      <dc:creator />
      <dc:date>2013-03-18T12:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449983#M486049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan, Thanks for your help yesterday.&amp;nbsp; Re-ran the QVD refresh and it seemed to work.&amp;nbsp; The QVD seems to be missing 890 records versus when I use SQL to query the table in the DB.&amp;nbsp; I think the NOT EXISTS (ID) might be the issue? Should I simply not CONTCATENATE and Qlikview will update edited recorded and/or load new records? Please advise Johnathan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the scrip which APPEARS to run fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD * FROM &lt;C&gt; (QVD); &lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_DATA INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL_BACKUP.QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxDate:&lt;/P&gt;&lt;P&gt;LOAD MAX(RL_EDIT_DATE)as MaxEditDate&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditDate = Date(Peek('MaxEditDate',0,'RL_MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as RL_EDIT_TIME&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (QVD)&lt;/C&gt;&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE = '$(vMaxEditDate)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxTime:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as MaxEditTime&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'RL_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO PRISMHC (XUserId is XVRGBZVMBDZeGXRNZTbA, XPassword is EAHfPZVMBDZeGXRNZLfB);&lt;/P&gt;&lt;P&gt;RL_New:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.RL (NOLOCK)&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE &amp;gt; '$(vMaxEditDate)' Or (RL_EDIT_DATE = '$(vMaxEditDate)' And RL_EDIT_TIME &amp;gt; '$(vMaxEditTime)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD * FROM C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD (QVD)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_New INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD;&lt;/P&gt;&lt;P&gt;DROP TABLES RL_MaxDate,RL_MaxTime,RL_New;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 06:13:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449983#M486049</guid>
      <dc:creator />
      <dc:date>2013-03-19T06:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449984#M486050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan, Thanks for your help yesterday.&amp;nbsp; Re-ran the QVD refresh and it seemed to work.&amp;nbsp; The QVD seems to be missing 890 records versus when I use SQL to query the table in the DB.&amp;nbsp; I think the NOT EXISTS (ID) might be the issue? Should I simply not CONTCATENATE and Qlikview will update edited recorded and/or load new records? Please advise Johnathan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the scrip which APPEARS to run fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD * FROM &lt;C&gt; (QVD); &lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_DATA INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL_BACKUP.QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxDate:&lt;/P&gt;&lt;P&gt;LOAD MAX(RL_EDIT_DATE)as MaxEditDate&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditDate = Date(Peek('MaxEditDate',0,'RL_MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as RL_EDIT_TIME&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (QVD)&lt;/C&gt;&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE = '$(vMaxEditDate)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxTime:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as MaxEditTime&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'RL_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO PRISMHC (XUserId is XVRGBZVMBDZeGXRNZTbA, XPassword is EAHfPZVMBDZeGXRNZLfB);&lt;/P&gt;&lt;P&gt;RL_New:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.RL (NOLOCK)&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE &amp;gt; '$(vMaxEditDate)' Or (RL_EDIT_DATE = '$(vMaxEditDate)' And RL_EDIT_TIME &amp;gt; '$(vMaxEditTime)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD * FROM C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD (QVD)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_New INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD;&lt;/P&gt;&lt;P&gt;DROP TABLES RL_MaxDate,RL_MaxTime,RL_New;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 06:13:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449984#M486050</guid>
      <dc:creator />
      <dc:date>2013-03-19T06:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449985#M486051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan, Thanks for your help yesterday.&amp;nbsp; Re-ran the QVD refresh and it seemed to work.&amp;nbsp; The QVD seems to be missing 890 records versus when I use SQL to query the table in the DB.&amp;nbsp; I think the NOT EXISTS (ID) might be the issue? Should I simply not CONTCATENATE and Qlikview will update edited recorded and/or load new records? Please advise Johnathan.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is the scrip which APPEARS to run fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD * FROM &lt;C&gt; (QVD); &lt;/C&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_DATA INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL_BACKUP.QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxDate:&lt;/P&gt;&lt;P&gt;LOAD MAX(RL_EDIT_DATE)as MaxEditDate&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditDate = Date(Peek('MaxEditDate',0,'RL_MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_DATA:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as RL_EDIT_TIME&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (QVD)&lt;/C&gt;&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE = '$(vMaxEditDate)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RL_MaxTime:&lt;/P&gt;&lt;P&gt;LOAD Max(RL_EDIT_TIME) as MaxEditTime&lt;/P&gt;&lt;P&gt;RESIDENT RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'RL_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE RL_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO PRISMHC (XUserId is XVRGBZVMBDZeGXRNZTbA, XPassword is EAHfPZVMBDZeGXRNZLfB);&lt;/P&gt;&lt;P&gt;RL_New:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.RL (NOLOCK)&lt;/P&gt;&lt;P&gt;WHERE RL_EDIT_DATE &amp;gt; '$(vMaxEditDate)' Or (RL_EDIT_DATE = '$(vMaxEditDate)' And RL_EDIT_TIME &amp;gt; '$(vMaxEditTime)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD * FROM C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD (QVD)&lt;/P&gt;&lt;P&gt;WHERE NOT EXISTS (ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE RL_New INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\RL.QVD;&lt;/P&gt;&lt;P&gt;DROP TABLES RL_MaxDate,RL_MaxTime,RL_New;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Mar 2013 06:13:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449985#M486051</guid>
      <dc:creator />
      <dc:date>2013-03-19T06:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449986#M486052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Not Exists(ID) will block loading duplicate values of ID, so if those values have IDs that are duplicates, then the not exists is the problem. If you need to bring these in, then you will need to create a temporary ID field to control the load.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your SELECT....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL SELECT *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID As T_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp; ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;And in your QVD load,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD ... WHERE Not Exists(T_ID, ID);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(This will break the optimised load for the QVD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 14:03:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449986#M486052</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-03-20T14:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449987#M486053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jonathan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry for being such a dubm-ass.&lt;/P&gt;&lt;P&gt;I seem to be duplicating records now. I need to REPLACE the records in the QVD with records from the SQL SELECT where the ID matches AND add any that dont EXIST in the QVD.&amp;nbsp; Any ideas please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Query is below:&lt;/P&gt;&lt;P&gt;QM_DATA:&lt;/P&gt;&lt;P&gt;LOAD * FROM &lt;C&gt; (QVD); &lt;/C&gt;&lt;/P&gt;&lt;P&gt;STORE QM_DATA INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\QM_BACKUP.QVD;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QM_MaxDate:&lt;/P&gt;&lt;P&gt;LOAD MAX(QM_EDIT_DATE)as MaxEditDate&lt;/P&gt;&lt;P&gt;RESIDENT QM_DATA; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditDate = Date(Peek('MaxEditDate',0,'QM_MaxDate'), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;DROP TABLE QM_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QM_DATA:&lt;/P&gt;&lt;P&gt;LOAD Max(QM_EDIT_TIME) as QM_EDIT_TIME&lt;/P&gt;&lt;P&gt;FROM &lt;C&gt; (QVD)&lt;/C&gt;&lt;/P&gt;&lt;P&gt;WHERE QM_EDIT_DATE = '$(vMaxEditDate)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QM_MaxTime:&lt;/P&gt;&lt;P&gt;LOAD Max(QM_EDIT_TIME) as MaxEditTime&lt;/P&gt;&lt;P&gt;RESIDENT QM_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vMaxEditTime = Num(Peek('MaxEditTime',0,'QM_MaxTime'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE QM_DATA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODBC CONNECT32 TO PRISMHC (XUserId is XVRGBZVMBDZeGXRNZTbA, XPassword is EAHfPZVMBDZeGXRNZLfB);&lt;/P&gt;&lt;P&gt;QM_New:&lt;/P&gt;&lt;P&gt;SQL&lt;/P&gt;&lt;P&gt;SELECT * FROM PWIN171.dbo.QM (NOLOCK)&lt;/P&gt;&lt;P&gt;WHERE QM_EDIT_DATE &amp;gt; '$(vMaxEditDate)' Or (QM_EDIT_DATE = '$(vMaxEditDate)' And QM_EDIT_TIME &amp;gt; '$(vMaxEditTime)');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE LOAD * FROM C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\QM.QVD (QVD);&lt;/P&gt;&lt;P&gt;//WHERE NOT EXISTS (ID); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE QM_New INTO C:\Users\tedder.bruce\Desktop\Qlikview Hirt &amp;amp; Carter\QVD\QM.QVD;&lt;/P&gt;&lt;P&gt;DROP TABLES QM_MaxDate,QM_MaxTime,QM_New;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 12:23:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449987#M486053</guid>
      <dc:creator />
      <dc:date>2013-04-03T12:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Update edited/new QVD records from DB</title>
      <link>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449988#M486054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do an incremental load to replace updated records, you need some way to identify the changed records, such as a last updated date/time field. You also need a unique key for each record (no duplicates). If your data does not meet these requirements, then you will not be able to update the QVD incrementally - you will have to do a full reload instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your data meets the above requirements, then you can incremental load with these steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Determine the last load time. This could be the maximum value of the last updated field in your QVD, or some other stored value indicating when the QVD was last refreshed, such as the QvdCreateTime function.&lt;/LI&gt;&lt;LI&gt;Load from the source all the records that have a last updated date greater than the last load time.&lt;/LI&gt;&lt;LI&gt;Load the date from the QVD, excluding those that were loaded from the source (because these records have been updated). Use Not(Exists()) as discussed earlier - but this does require that the ID field (or whatever key you choose) is unique for each record.&lt;/LI&gt;&lt;LI&gt;Store the updated QVD.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope that helps. If you have more questions, I suggest that you open a new thread (referencing this thread if you like). This one has been marked as answered, so you are less likely to get more help here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 11:21:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Update-edited-new-QVD-records-from-DB/m-p/449988#M486054</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2013-04-04T11:21:36Z</dc:date>
    </item>
  </channel>
</rss>

