<?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 Incremental load from PostgreSQL in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Incremental-load-from-PostgreSQL/m-p/1780792#M5765</link>
    <description>&lt;P&gt;Hi, I'm trying to do an incremental load from PostgreSQL. Currently I have this code&lt;/P&gt;&lt;P&gt;let ThisExecTime = Date(Today(), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;[measurement]:&lt;/P&gt;&lt;P&gt;LOAD Date(meas_date) as %DateKey,&lt;BR /&gt;Time(meas_time) as Måletidspunkt,&lt;BR /&gt;meas_time,&lt;BR /&gt;tag_id,&lt;BR /&gt;meas_value;&lt;BR /&gt;&lt;BR /&gt;Select date("meas_time") as meas_date,&lt;BR /&gt;"meas_time",&lt;BR /&gt;"tag_id",&lt;BR /&gt;"meas_value"&lt;BR /&gt;from measurement&lt;BR /&gt;where tag_id in(348, 341, 694, 695, 698, 699, 349, 1020)&lt;BR /&gt;and meas_time &amp;gt;= '2021-02-07' //'$(PreviousExecTime )' Using static date for test purpose&lt;BR /&gt;AND meas_time &amp;lt; '$(ThisExecTime)';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;concatenate LOAD %DateKey, Måletidspunkt, meas_time, tag_id, meas_value&lt;BR /&gt;FROM 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd';&lt;BR /&gt;//WHERE NOT Exists(tag_id, meas_time);&lt;/P&gt;&lt;P&gt;STORE measurement INTO 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd';&lt;/P&gt;&lt;P&gt;let PreviousExecTime = ThisExecTime;&lt;/P&gt;&lt;P&gt;On "concatenate LOAD %DateKey..." i get the error: "&lt;SPAN&gt;Field '%DateKey' not found". However, both in my preceding load statement and in the QVD file (picture of QVD file attached) I have %DateKey.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additionally when "WHERE NOT Exists(tag_id, meas_time)" is uncommented I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Unexpected token: 'tag_id', expected one of: 'txt', 'Table', 'tab', 'biff', 'dif', 'fix', 'html', ...: concatenate LOAD %DateKey, Måletidspunkt, meas_time, tag_id, meas_value FROM 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd' WHERE NOT Exists(&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;tag_id&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;, meas_time)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;From the documentation:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm," target="_blank"&gt;https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm,&lt;/A&gt;&amp;nbsp;the primary key should be in the not exist statement, in my case, I have a composite PK. Is that a problem?&lt;BR /&gt;I don't quite get why it would expect a table or html (and some of the others which I don't know what is). Using the measurement table, i get similar error message.&lt;/P&gt;&lt;P&gt;How can I fix these errors?&lt;/P&gt;&lt;P&gt;Thanks in advance for any help&lt;/P&gt;</description>
    <pubDate>Fri, 10 Dec 2021 20:23:41 GMT</pubDate>
    <dc:creator>martinholm</dc:creator>
    <dc:date>2021-12-10T20:23:41Z</dc:date>
    <item>
      <title>Incremental load from PostgreSQL</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Incremental-load-from-PostgreSQL/m-p/1780792#M5765</link>
      <description>&lt;P&gt;Hi, I'm trying to do an incremental load from PostgreSQL. Currently I have this code&lt;/P&gt;&lt;P&gt;let ThisExecTime = Date(Today(), 'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;[measurement]:&lt;/P&gt;&lt;P&gt;LOAD Date(meas_date) as %DateKey,&lt;BR /&gt;Time(meas_time) as Måletidspunkt,&lt;BR /&gt;meas_time,&lt;BR /&gt;tag_id,&lt;BR /&gt;meas_value;&lt;BR /&gt;&lt;BR /&gt;Select date("meas_time") as meas_date,&lt;BR /&gt;"meas_time",&lt;BR /&gt;"tag_id",&lt;BR /&gt;"meas_value"&lt;BR /&gt;from measurement&lt;BR /&gt;where tag_id in(348, 341, 694, 695, 698, 699, 349, 1020)&lt;BR /&gt;and meas_time &amp;gt;= '2021-02-07' //'$(PreviousExecTime )' Using static date for test purpose&lt;BR /&gt;AND meas_time &amp;lt; '$(ThisExecTime)';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;concatenate LOAD %DateKey, Måletidspunkt, meas_time, tag_id, meas_value&lt;BR /&gt;FROM 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd';&lt;BR /&gt;//WHERE NOT Exists(tag_id, meas_time);&lt;/P&gt;&lt;P&gt;STORE measurement INTO 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd';&lt;/P&gt;&lt;P&gt;let PreviousExecTime = ThisExecTime;&lt;/P&gt;&lt;P&gt;On "concatenate LOAD %DateKey..." i get the error: "&lt;SPAN&gt;Field '%DateKey' not found". However, both in my preceding load statement and in the QVD file (picture of QVD file attached) I have %DateKey.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Additionally when "WHERE NOT Exists(tag_id, meas_time)" is uncommented I get the error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Unexpected token: 'tag_id', expected one of: 'txt', 'Table', 'tab', 'biff', 'dif', 'fix', 'html', ...: concatenate LOAD %DateKey, Måletidspunkt, meas_time, tag_id, meas_value FROM 'lib://01. Data repository Prod/2_Transform/Biologisk/Measurement.qvd' WHERE NOT Exists(&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;tag_id&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;, meas_time)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;From the documentation:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm," target="_blank"&gt;https://help.qlik.com/en-US/sense/November2020/Subsystems/Hub/Content/Sense_Hub/LoadData/use-QVD-files-incremental-load.htm,&lt;/A&gt;&amp;nbsp;the primary key should be in the not exist statement, in my case, I have a composite PK. Is that a problem?&lt;BR /&gt;I don't quite get why it would expect a table or html (and some of the others which I don't know what is). Using the measurement table, i get similar error message.&lt;/P&gt;&lt;P&gt;How can I fix these errors?&lt;/P&gt;&lt;P&gt;Thanks in advance for any help&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:23:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Incremental-load-from-PostgreSQL/m-p/1780792#M5765</guid>
      <dc:creator>martinholm</dc:creator>
      <dc:date>2021-12-10T20:23:41Z</dc:date>
    </item>
  </channel>
</rss>

