<?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>article Qlik Replicate: Join different tables in source database and filter records in Full Lod and CDC stages in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Join-different-tables-in-source-database-and/ta-p/2421556</link>
    <description>&lt;P&gt;Sometimes we need to join different tables in the source databases and filter records according to another table records values. In this article we are using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Oracle source endpoint&lt;/STRONG&gt;&lt;/FONT&gt;, to demonstrate how to build up such a task in Qlik Replicate&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the below sample task, table&amp;nbsp;&lt;FONT face="courier new,courier"&gt;testfilter&lt;/FONT&gt; will be replicated from Oracle source database to SQL Server target database. During the replication, the records which value is &lt;FONT face="courier new,courier"&gt;INACTIVE&lt;/FONT&gt; in table &lt;FONT face="courier new,courier"&gt;testfiltercondition&lt;/FONT&gt; will be filtered out and are ignored in both Full Load and CDC stages. The two tables are joined by the same primary key column "id".&lt;/P&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Detailed information:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;In Oracle database prepare 2 tables&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;create table testfilter (id integer not null primary key, name char(20), notes char(200));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (2,'John','ACTIVE will pass the filter');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (3,'Sybase','INACTIVE will be ignored');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (5,'Hana','ACTIVE will pass the filter');&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;create table testfiltercondition (id integer not null primary key, status char(20)); &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (2,'ACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (3,'INACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (5,'ACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;In Qlik Replicate the table &lt;FONT face="courier new,courier"&gt;testfilter&lt;/FONT&gt; is included in a Full Load and Apply Changes enabled task.&lt;/LI&gt;
&lt;LI&gt;In Table Settings --&amp;gt; Transformation, let's add an additional column name "&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" which computed expression is:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source_lookup('NO_CACHING','SCOTT','TESTFILTERCONDITION','STATUS','ID=:1',$ID)&lt;/FONT&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_2-1708501310020.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160322iA39BB69506CC871F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_2-1708501310020.png" alt="john_wang_2-1708501310020.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_3-1708501389213.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160323i8E77B852F5B5FE03/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_3-1708501389213.png" alt="john_wang_3-1708501389213.png" /&gt;&lt;/span&gt;
&lt;P&gt;In the above expression, the 2 tables &lt;FONT face="courier new,courier"&gt;testfilter &lt;/FONT&gt;and &lt;FONT face="courier new,courier"&gt;testfiltercondition &lt;/FONT&gt;are joined by the PK column "id" in function &lt;A title="source_lookup" href="https://help.qlik.com/en-US/replicate/November2023/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_expressOther.htm#Data2:~:text=Data%20Enrichment%20functions-,Function,Use%20to%20retrieve%20additional%20data%20from%20the%20source%20endpoint.,-target_lookup(TTL%2C%27SCHM" target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup&lt;/FONT&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;In Table Settings --&amp;gt; Filter add a filter on the column&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" which value equal to "&lt;FONT face="courier new,courier"&gt;ACTIVE&lt;/FONT&gt;"&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_4-1708501729373.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160325iBEC0BC0DC8BC45EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_4-1708501729373.png" alt="john_wang_4-1708501729373.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;In target side tables, only rows with "&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" equal to "&lt;FONT face="courier new,courier"&gt;ACTIVE&lt;/FONT&gt;" are replicated. Other rows were filtered out. The filter takes action for both Full Load and CDC stages.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_5-1708501867820.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160326iF70B62CA0599B4FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_5-1708501867820.png" alt="john_wang_5-1708501867820.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Internal Investigation ID(s):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;#00145952&lt;/P&gt;
&lt;H3 id="toc-hId--1641080451"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Related Content&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A title="QnA with Qlik: Qlik Replicate Tips" href="https://community.qlik.com/t5/Video-Transcripts/QnA-with-Qlik-Qlik-Replicate-Tips/ta-p/2067223" target="_blank" rel="noopener"&gt;QnA with Qlik: Qlik Replicate Tips&lt;/A&gt;&lt;/P&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Replicate All versions&lt;/LI&gt;
&lt;LI&gt;Oracle All versions&lt;BR /&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Wed, 21 Feb 2024 08:02:07 GMT</pubDate>
    <dc:creator>john_wang</dc:creator>
    <dc:date>2024-02-21T08:02:07Z</dc:date>
    <item>
      <title>Qlik Replicate: Join different tables in source database and filter records in Full Lod and CDC stages</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Join-different-tables-in-source-database-and/ta-p/2421556</link>
      <description>&lt;P&gt;Sometimes we need to join different tables in the source databases and filter records according to another table records values. In this article we are using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Oracle source endpoint&lt;/STRONG&gt;&lt;/FONT&gt;, to demonstrate how to build up such a task in Qlik Replicate&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the below sample task, table&amp;nbsp;&lt;FONT face="courier new,courier"&gt;testfilter&lt;/FONT&gt; will be replicated from Oracle source database to SQL Server target database. During the replication, the records which value is &lt;FONT face="courier new,courier"&gt;INACTIVE&lt;/FONT&gt; in table &lt;FONT face="courier new,courier"&gt;testfiltercondition&lt;/FONT&gt; will be filtered out and are ignored in both Full Load and CDC stages. The two tables are joined by the same primary key column "id".&lt;/P&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Detailed information:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;In Oracle database prepare 2 tables&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;create table testfilter (id integer not null primary key, name char(20), notes char(200));&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (2,'John','ACTIVE will pass the filter');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (3,'Sybase','INACTIVE will be ignored');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfilter values (5,'Hana','ACTIVE will pass the filter');&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;create table testfiltercondition (id integer not null primary key, status char(20)); &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (2,'ACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (3,'INACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;insert into testfiltercondition values (5,'ACTIVE');&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;In Qlik Replicate the table &lt;FONT face="courier new,courier"&gt;testfilter&lt;/FONT&gt; is included in a Full Load and Apply Changes enabled task.&lt;/LI&gt;
&lt;LI&gt;In Table Settings --&amp;gt; Transformation, let's add an additional column name "&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" which computed expression is:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;source_lookup('NO_CACHING','SCOTT','TESTFILTERCONDITION','STATUS','ID=:1',$ID)&lt;/FONT&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_2-1708501310020.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160322iA39BB69506CC871F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_2-1708501310020.png" alt="john_wang_2-1708501310020.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_3-1708501389213.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160323i8E77B852F5B5FE03/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_3-1708501389213.png" alt="john_wang_3-1708501389213.png" /&gt;&lt;/span&gt;
&lt;P&gt;In the above expression, the 2 tables &lt;FONT face="courier new,courier"&gt;testfilter &lt;/FONT&gt;and &lt;FONT face="courier new,courier"&gt;testfiltercondition &lt;/FONT&gt;are joined by the PK column "id" in function &lt;A title="source_lookup" href="https://help.qlik.com/en-US/replicate/November2023/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_expressOther.htm#Data2:~:text=Data%20Enrichment%20functions-,Function,Use%20to%20retrieve%20additional%20data%20from%20the%20source%20endpoint.,-target_lookup(TTL%2C%27SCHM" target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;source_lookup&lt;/FONT&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;In Table Settings --&amp;gt; Filter add a filter on the column&amp;nbsp;"&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" which value equal to "&lt;FONT face="courier new,courier"&gt;ACTIVE&lt;/FONT&gt;"&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_4-1708501729373.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160325iBEC0BC0DC8BC45EC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_4-1708501729373.png" alt="john_wang_4-1708501729373.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;In target side tables, only rows with "&lt;FONT face="courier new,courier"&gt;&lt;EM&gt;status&lt;/EM&gt;&lt;/FONT&gt;" equal to "&lt;FONT face="courier new,courier"&gt;ACTIVE&lt;/FONT&gt;" are replicated. Other rows were filtered out. The filter takes action for both Full Load and CDC stages.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="john_wang_5-1708501867820.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/160326iF70B62CA0599B4FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="john_wang_5-1708501867820.png" alt="john_wang_5-1708501867820.png" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Internal Investigation ID(s):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;P&gt;#00145952&lt;/P&gt;
&lt;H3 id="toc-hId--1641080451"&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt;Related Content&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H3&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;A title="QnA with Qlik: Qlik Replicate Tips" href="https://community.qlik.com/t5/Video-Transcripts/QnA-with-Qlik-Qlik-Replicate-Tips/ta-p/2067223" target="_blank" rel="noopener"&gt;QnA with Qlik: Qlik Replicate Tips&lt;/A&gt;&lt;/P&gt;
&lt;H3 id="toc-hId--525314414"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;Qlik Replicate All versions&lt;/LI&gt;
&lt;LI&gt;Oracle All versions&lt;BR /&gt;&lt;LI-PRODUCT title="Qlik Replicate" id="qlikReplicate"&gt;&lt;/LI-PRODUCT&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 21 Feb 2024 08:02:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Qlik-Replicate-Join-different-tables-in-source-database-and/ta-p/2421556</guid>
      <dc:creator>john_wang</dc:creator>
      <dc:date>2024-02-21T08:02:07Z</dc:date>
    </item>
  </channel>
</rss>

