<?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: Compare source and target row count and send deleted records in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246430#M31951</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I would just go for an inner join, the output ive added the trgt source too to make sure it was null when testing&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tMap_JoinReject.png" style="width: 954px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzTa.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132858i3C2ED2FEEFD08636/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzTa.png" alt="0683p000009LzTa.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Aug 2018 11:49:39 GMT</pubDate>
    <dc:creator>Jesperrekuh</dc:creator>
    <dc:date>2018-08-29T11:49:39Z</dc:date>
    <item>
      <title>Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246429#M31950</link>
      <description>Hi there 
&lt;BR /&gt; 
&lt;BR /&gt;I am building a flow where I want to achieve following: 
&lt;BR /&gt; 
&lt;BR /&gt;I am building a flow where I want to achieve below: 
&lt;BR /&gt; 
&lt;BR /&gt;I’m using Talend 6.4 and redshift 
&lt;BR /&gt; 
&lt;BR /&gt;1.Find count of ids in source vs target. 
&lt;BR /&gt;2. Comparison - If count matches then proceed to next job. If counts don’t match then find those ids which aren’t in destination but in source (appearantly been deleted). Therefore, mark them as deleted. 
&lt;BR /&gt; 
&lt;BR /&gt;How do I build this flow? What components should I use?</description>
      <pubDate>Sat, 16 Nov 2024 07:45:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246429#M31950</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2024-11-16T07:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246430#M31951</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I would just go for an inner join, the output ive added the trgt source too to make sure it was null when testing&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tMap_JoinReject.png" style="width: 954px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzTa.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/132858i3C2ED2FEEFD08636/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzTa.png" alt="0683p000009LzTa.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 11:49:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246430#M31951</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-08-29T11:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246431#M31952</link>
      <description>Hi Dijke thanks for your reply.&lt;BR /&gt;&lt;BR /&gt;How do I get counts of source and target and compare them?</description>
      <pubDate>Wed, 29 Aug 2018 20:34:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246431#M31952</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2018-08-29T20:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246432#M31953</link>
      <description>If you want to count in talend you basically retrieve records first... so you might as well join them to get the 'deleted' records and run the syncing process so you are always correct. 
&lt;BR /&gt;If both sources are tables : 
&lt;BR /&gt;select count(*) cnt, count(distinct id) unique_cnt from src_table 
&lt;BR /&gt; 
&lt;BR /&gt;My experience on counting records to track if you;re in sync... is a dirty fix 
&lt;BR /&gt;Think of reasons why your record count between source and target could be equal but when you compare the data it turns out to be different. Like moving records to a backup environment... or ... records in src first deleted (5records) and later coincidence 5 records are added, your count hasn't changed. 
&lt;BR /&gt; 
&lt;BR /&gt;Be schwifty 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Wed, 29 Aug 2018 21:57:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246432#M31953</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-08-29T21:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246433#M31954</link>
      <description>Hi Dijke 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks for your prompt reply. 
&lt;BR /&gt; 
&lt;BR /&gt;Let me give you little bit of background so that things are clear. 
&lt;BR /&gt; 
&lt;BR /&gt;I have already got existing flow which caters for inserts and updates. 
&lt;BR /&gt; 
&lt;BR /&gt;Deletes were not handled at all so that’s what I’m doing now. 
&lt;BR /&gt; 
&lt;BR /&gt;I only want to run delete flow assuming ids don’t match. In matching case I don’t want to do anything and proceed to next one. 
&lt;BR /&gt; 
&lt;BR /&gt;Only because of performance every time I don’t want to check how many records were deleted instead only go to delete flow when records are not matching. Hopefully this makes sense. 
&lt;BR /&gt; 
&lt;BR /&gt;So I’m focused more on comparison for counts. Could you please help here? 
&lt;BR /&gt; 
&lt;BR /&gt;Thanks 
&lt;BR /&gt;Harshal.</description>
      <pubDate>Wed, 29 Aug 2018 22:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246433#M31954</guid>
      <dc:creator>Parikhharshal</dc:creator>
      <dc:date>2018-08-29T22:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Compare source and target row count and send deleted records</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246434#M31955</link>
      <description>&lt;P&gt;Hi, yeah I (think I) get it...&amp;nbsp; You only want to delete if the count doesn't match? right?&lt;/P&gt; 
&lt;P&gt;tMSSQLInput_1 : "select count(*) src_cnt from src_table"&amp;nbsp; --&amp;gt;&amp;nbsp; tSetGlobalVar1&lt;/P&gt; 
&lt;P&gt;tMSSQLInput_2 : "select count(*) trg_cnt from trg_table"&amp;nbsp; --&amp;gt; tSetGlobalVar2&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Count.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lzh3.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141780iDF25D805687F83FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lzh3.png" alt="0683p000009Lzh3.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Basically your count results go into global vars and next after the counts have run... you use an if&lt;BR /&gt;In the --- if ---&amp;gt; you check the values which are set in the global var:&lt;BR /&gt;((Integer)globalMap.get("src_cnt")) &amp;lt;&amp;gt; ((Integer)globalMap.get("trg_cnt"))&lt;BR /&gt;Finally In the tRunJob call the job for deleting and (non) matching records.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 22:54:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Compare-source-and-target-row-count-and-send-deleted-records/m-p/2246434#M31955</guid>
      <dc:creator>Jesperrekuh</dc:creator>
      <dc:date>2018-08-29T22:54:34Z</dc:date>
    </item>
  </channel>
</rss>

