<?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: Get First Value on New Columns using Expression Builder in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1703236#M181</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your enquiry.&lt;/P&gt;&lt;P&gt;Please check the below transformation for your problem.&lt;/P&gt;&lt;P&gt;case $AR_H_OPERATION when 'UPDATE'&lt;BR /&gt;then&lt;BR /&gt;target_lookup('NO_CACHING','TGT_SYSTEM','TEST_O_S','CURR_DT','ID=:1',$ID)&lt;BR /&gt;else&lt;BR /&gt;datetime('now','localtime')&lt;BR /&gt;end&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;P&gt;TGT_SYSTEM: target_schema_name&lt;/P&gt;&lt;P&gt;TEST_O_S: table_name&lt;/P&gt;&lt;P&gt;CURR_DT:Date column&lt;/P&gt;&lt;P&gt;ID: primary key column&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 21:51:13 GMT</pubDate>
    <dc:creator>Madhavi_Konda</dc:creator>
    <dc:date>2020-05-18T21:51:13Z</dc:date>
    <item>
      <title>Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1702715#M178</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;i want to add a new column 'CREATION_DATE' in target table that will have the very first value where task is running.&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;at 7pm . because of new row has been added in source table, on target table the value will be '17/05/2020 19.00'&amp;nbsp;&lt;/P&gt;&lt;P&gt;*i use datetime(now,localtime) function&lt;/P&gt;&lt;P&gt;at 8pm, there is an update data in previous row, then the value i want is still&amp;nbsp;&amp;nbsp;'17/05/2020 19.00'&amp;nbsp; , not&amp;nbsp;'17/05/2020 20:00'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there any way to accomodate this logic? I've tried using ifnull(CREATION_DATE,datetime(now,localtime) ) but return with error. SqlLite error message no such column CREATION_DATE .&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 19:31:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1702715#M178</guid>
      <dc:creator>rendyajisoko</dc:creator>
      <dc:date>2020-05-16T19:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1703236#M181</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your enquiry.&lt;/P&gt;&lt;P&gt;Please check the below transformation for your problem.&lt;/P&gt;&lt;P&gt;case $AR_H_OPERATION when 'UPDATE'&lt;BR /&gt;then&lt;BR /&gt;target_lookup('NO_CACHING','TGT_SYSTEM','TEST_O_S','CURR_DT','ID=:1',$ID)&lt;BR /&gt;else&lt;BR /&gt;datetime('now','localtime')&lt;BR /&gt;end&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;P&gt;TGT_SYSTEM: target_schema_name&lt;/P&gt;&lt;P&gt;TEST_O_S: table_name&lt;/P&gt;&lt;P&gt;CURR_DT:Date column&lt;/P&gt;&lt;P&gt;ID: primary key column&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Madhavi&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 21:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1703236#M181</guid>
      <dc:creator>Madhavi_Konda</dc:creator>
      <dc:date>2020-05-18T21:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704010#M186</link>
      <description>&lt;P&gt;Hi Madhavi,&lt;/P&gt;&lt;P&gt;thanks for you reply&lt;/P&gt;&lt;P&gt;but I still not get the value i want.&lt;/P&gt;&lt;P&gt;i modified your transformation script into this :&lt;/P&gt;&lt;P&gt;case $AR_H_OPERATION&lt;BR /&gt;WHEN 'INSERT' THEN DATETIME('NOW','LOCALTIME')&lt;BR /&gt;WHEN 'UPDATE' THEN&lt;BR /&gt;target_lookup('NO_CACHING','ELLSTG9','MSFXXX','CREATION_DATE_DWH','TABLE_TYPE=:1','TABLE_CODE=:2',$TABLE_TYPE,$TABLE_CODE)&lt;BR /&gt;WHEN 'DELETE' THEN&lt;BR /&gt;target_lookup('NO_CACHING','ELLSTG9','MSFXXX,'CREATION_DATE_DWH','TABLE_TYPE=:1','TABLE_CODE=:2',$TABLE_TYPE,$TABLE_CODE)&lt;BR /&gt;else&lt;BR /&gt;DATETIME('NOW','LOCALTIME')&lt;BR /&gt;end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Actually I have created a general transformation to add new column named 'CREATION_DATE_DWH' type Datetime(6) with no expression (leave blank / NULL) , this applied to all of my tables. . and also for this table MSFXXX ,i created specific transformation&amp;nbsp; where on 'CREATION_DATE_DWH' column&amp;nbsp; I insert my script above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did save and stop TASK, resume processing and reload MSFXXX .&amp;nbsp;&lt;/P&gt;&lt;P&gt;checked my&amp;nbsp; &amp;nbsp;'CREATION_DATE_DWH'&amp;nbsp; , value still null&amp;nbsp;&lt;/P&gt;&lt;P&gt;tried to insert new row from source database, I got error&amp;nbsp; &lt;FONT color="#FF0000"&gt;Trying to reconnect to target database&lt;/FONT&gt;&amp;nbsp; and SQLLite error message unknown (see attachment)&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 23:21:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704010#M186</guid>
      <dc:creator>rendyajisoko</dc:creator>
      <dc:date>2020-05-20T23:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704011#M187</link>
      <description>&lt;P&gt;The case --&lt;/P&gt;&lt;P&gt;when condition are&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reload ---&amp;gt; value = date reload&lt;/P&gt;&lt;P&gt;insert ---&amp;gt; value = date insert&lt;/P&gt;&lt;P&gt;update/delete ---&amp;gt; value still date insert / date reload ... value not change&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my purpose is I want to get the first date where my data has been replicate to my target DB (reload/insert)&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please help, i believe Qlik Replicate have the ability to do this&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 23:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704011#M187</guid>
      <dc:creator>rendyajisoko</dc:creator>
      <dc:date>2020-05-20T23:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704228#M188</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;There is quote missing near 'MSFXXX in DELETE part. You don't need to keep all the conditions in your transforamtion.&lt;BR /&gt;Please use the one that I provided to you initially for your requirement. It will give the current timestamp for the fullload and&lt;BR /&gt;for new inserts and target value for updates. You don't really need to keep a condition for DELETEs&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Madhavi&lt;/P&gt;</description>
      <pubDate>Thu, 21 May 2020 17:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704228#M188</guid>
      <dc:creator>Madhavi_Konda</dc:creator>
      <dc:date>2020-05-21T17:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704351#M190</link>
      <description>&lt;P&gt;weird, still null..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i found another method. which is on creation_date_dwh column , i create default value sysdate , then&amp;nbsp; remove it on my transformation. case solved. i totally forgot about basic rule oracle can do.. pardon me..&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your attention and support Madhavi, GBU and stay healthy.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 10:19:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1704351#M190</guid>
      <dc:creator>rendyajisoko</dc:creator>
      <dc:date>2020-05-22T10:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get First Value on New Columns using Expression Builder</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1768775#M661</link>
      <description>&lt;P&gt;This approach appears to have a limitation that is dependent upon the Attunity Task in question to be in Transactional Apply mode instead of Batch Optimized Apply. Per the Setup/User guide on page 51:&lt;/P&gt;&lt;P&gt;"In Batch Optimized Apply mode, if the target table has more columns than the&lt;BR /&gt;source table, any values in the extra columns will be replaced with NULL"&lt;/P&gt;&lt;P&gt;We tested a slight variation of this solution in Batch Optimized Apply mode. In our situation we would like to have&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;a create_date column for when the row was created&lt;/LI&gt;&lt;LI&gt;a modify_date for when the row was last updated&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Including default value constraints and a BEFORE UPDATE trigger (to update the modify_date column) in the table DDL seemed like it would take care of this. However:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If the columns are scoped with a NOT NULL constraint:&lt;UL&gt;&lt;LI&gt;On INSERT, Attunity will log an exception because both columns are NULL&lt;/LI&gt;&lt;LI&gt;On UPDATE, Attunity will also log an exception because one column is NULL&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;If the columns are not scoped with a NOT NULL constraint:&lt;UL&gt;&lt;LI&gt;On INSERT, Attunity will insert the row with both columns as NULL&lt;/LI&gt;&lt;LI&gt;On UPDATE, Attunity will insert the row with one column as NULL&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Looks like our options are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Complex Global Transformation proposed here&lt;/LI&gt;&lt;LI&gt;Attempt to switch to Transactional Apply&lt;/LI&gt;&lt;LI&gt;Some other solution&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 15 Dec 2020 23:18:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Get-First-Value-on-New-Columns-using-Expression-Builder/m-p/1768775#M661</guid>
      <dc:creator>alex_thornbury</dc:creator>
      <dc:date>2020-12-15T23:18:53Z</dc:date>
    </item>
  </channel>
</rss>

