<?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: Qlik replicate discarding replication filter in Qlik Replicate</title>
    <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2463356#M11595</link>
    <description>&lt;P&gt;Thank you for your reply. We will try the ifnull verification for the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;SBL__S_CONTACT__PR_GRP_OU_ID column. You are right about the costly return trip to verify the existence of its value for each row.&lt;BR /&gt;&lt;BR /&gt;I think it would be more efficient to apply the following filter verifying that the previous value differs from the new value . Those 4 values correspond to the columns we included in our transformation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;ifnull($BI__ROW_ID,'null') != ifnull($ROW_ID,'null') or
ifnull($BI__MAIN_PH_NUM,'null') != ifnull($MAIN_PH_NUM,'null') or
ifnull($BI__TYPE_CD,'null') != ifnull($TYPE_CD,'null') or
ifnull($BI__X_MAIN_PH_NUM_LR,'null') != ifnull($X_MAIN_PH_NUM_LR,'null')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards, groeten,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ole Dufour&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 13:28:18 GMT</pubDate>
    <dc:creator>Ole_Dufour</dc:creator>
    <dc:date>2024-06-19T13:28:18Z</dc:date>
    <item>
      <title>Qlik replicate discarding replication filter</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2461718#M11487</link>
      <description>&lt;P&gt;In the source table we are updating a value. Replication should only execute if SBL__S_CONTACT__PR_GRP_OU_ID exists in both source and destination. &lt;BR /&gt;&lt;BR /&gt;In order to achieve this we configured the filter as follows:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;$AR_H_OPERATION ='UPDATE' &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;and target_lookup('NO_CACHING','BPUSTAGING','PERSONNE_PHYSIQUE','SBL__S_CONTACT__PR_GRP_OU_ID','SBL__S_CONTACT__PR_GRP_OU_ID=:1',$ROW_ID) !=''&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;SBL__S_CONTACT__PR_GRP_OU_ID is a non unique column in the destination table. This column is mapped with ROW_ID, a primary key in the source table.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Looking in the attrep_apply_exceptions table we are getting a lot of errors like the one below:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DECLARE v_count VARCHAR2(100); &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;BEGIN UPDATE "BPUSTAGING"."PERSONNE_PHYSIQUE" SET "SBL__S_CONTACT__PR_GRP_OU_ID"='1-1OA4J-2'&lt;BR /&gt;&lt;/FONT&gt;&lt;SPAN&gt;, "TELEPHONE_FIXE_NUMERO"=NULL &lt;BR /&gt;, "SBL__S_ORG_GROUP__TYPE_CD"=NULL &lt;BR /&gt;, "TELEPHONE_FIXE_BLOC_TEL"=NULL &lt;BR /&gt;WHERE "SBL__S_CONTACT__PR_GRP_OU_ID"='1-1OA4J-2' &lt;BR /&gt;AND "TELEPHONE_FIXE_NUMERO" is NULL &lt;BR /&gt;AND "SBL__S_ORG_GROUP__TYPE_CD" is NULL &lt;BR /&gt;AND "TELEPHONE_FIXE_BLOC_TEL" is NULL ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;v_count:= SQL%ROWCOUNT;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if v_count = 0 then INSERT INTO "BPUSTAGING"."PERSONNE_PHYSIQUE" ( "TELEPHONE_FIXE_NUMERO","TELEPHONE_FIXE_BLOC_TEL","SBL__S_CONTACT__PR_GRP_OU_ID","SBL__S_ORG_GROUP__TYPE_CD" ) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;VALUES ( NULL,NULL,'1-1OA4J-2',NULL); &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;end if;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;END;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;ORA-01400: impossible d''ins rer NULL dans ("BPUSTAGING"."PERSONNE_PHYSIQUE"."REFERENCE") ORA-06512: ligne 1 ORA-06512: ligne 1&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Question :&lt;BR /&gt;Why is Qlik trying to replicate the row given that the filter requires the value to exist in the destination table ?&lt;/P&gt;
&lt;P&gt;For the sake of completeness I am including a screenshot of the filter and the transformations :&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ole_Dufour_1-1718194585071.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/167816iAAD01B603F022678/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ole_Dufour_1-1718194585071.png" alt="Ole_Dufour_1-1718194585071.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ole_Dufour_0-1718194537994.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/167815i48EB805B4FE14470/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ole_Dufour_0-1718194537994.png" alt="Ole_Dufour_0-1718194537994.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 13:07:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2461718#M11487</guid>
      <dc:creator>Ole_Dufour</dc:creator>
      <dc:date>2024-06-12T13:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik replicate discarding replication filter</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2461928#M11493</link>
      <description>&lt;P&gt;My WAG is that the lookup is returning a NULL and not an empty string on non-existing row.&lt;/P&gt;
&lt;P&gt;Instead of returning&amp;nbsp;&lt;SPAN&gt;SBL__S_CONTACT__PR_GRP_OU_ID, and NOT really using that value I would return some piece for arbitrary string like "gevonden" and test for != 'gevonden'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Alternatively, try playing with &lt;STRONG&gt;ifnull&lt;/STRONG&gt; or &lt;STRONG&gt;coalescence &lt;/STRONG&gt;to get a piece of (empty) string if not found.&lt;/P&gt;
&lt;P&gt;Mind you, on the whole, I get the impression you are trying to convert Replicate into something it is not really designed to be. It is NOT a programming / processing language, just a data movement tool with some bells and whistles. A change was made on the source - therefor it belongs on the target is my guiding principle. You may need to just replicate to intermediary tables and then apply additional business logic on target, perhaps with a TRIGGER or with a repeating scheduled job.&lt;/P&gt;
&lt;P&gt;The price for a lookup is a round-trip to source or target for each and every row. For targets like Snowflake it is much better to trigger it with a bulk of data and let the target figure it out with all data rigth there and full SQL flexibility vs the contrived and limited lookup syntax.&lt;/P&gt;
&lt;P&gt;Free advice! Worth every penny.&lt;/P&gt;
&lt;P&gt;Hein.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:26:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2461928#M11493</guid>
      <dc:creator>Heinvandenheuvel</dc:creator>
      <dc:date>2024-06-12T21:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik replicate discarding replication filter</title>
      <link>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2463356#M11595</link>
      <description>&lt;P&gt;Thank you for your reply. We will try the ifnull verification for the&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;SBL__S_CONTACT__PR_GRP_OU_ID column. You are right about the costly return trip to verify the existence of its value for each row.&lt;BR /&gt;&lt;BR /&gt;I think it would be more efficient to apply the following filter verifying that the previous value differs from the new value . Those 4 values correspond to the columns we included in our transformation.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;ifnull($BI__ROW_ID,'null') != ifnull($ROW_ID,'null') or
ifnull($BI__MAIN_PH_NUM,'null') != ifnull($MAIN_PH_NUM,'null') or
ifnull($BI__TYPE_CD,'null') != ifnull($TYPE_CD,'null') or
ifnull($BI__X_MAIN_PH_NUM_LR,'null') != ifnull($X_MAIN_PH_NUM_LR,'null')&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards, groeten,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ole Dufour&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 13:28:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Replicate/Qlik-replicate-discarding-replication-filter/m-p/2463356#M11595</guid>
      <dc:creator>Ole_Dufour</dc:creator>
      <dc:date>2024-06-19T13:28:18Z</dc:date>
    </item>
  </channel>
</rss>

