<?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 Transformation: Source - Filter for Delete in Official Support Articles</title>
    <link>https://community.qlik.com/t5/Official-Support-Articles/Transformation-Source-Filter-for-Delete/ta-p/1947635</link>
    <description>&lt;H4 id="toc-hId--514842870"&gt;Environment&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Replicate&lt;/LI&gt;
&lt;LI&gt;Table/Field level Filter&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.&lt;/P&gt;
&lt;H3 id="toc-hId--525350720"&gt;Filter Transformation&lt;/H3&gt;
&lt;P&gt;A common use of filter expressions is to check a field in the record for a specific value&amp;nbsp; and then either allow or not allow the delete transaction to replicate to the target.&lt;/P&gt;
&lt;P&gt;The task was set up to filter deletes from the source with a transformation expression to check a field for a value of 1&lt;/P&gt;
&lt;H4&gt;The complete transformation code as follows&lt;/H4&gt;
&lt;LI-CODE lang="markup"&gt;CASE WHEN $AR_H_STREAM_POSITION != ''
  THEN
     CASE WHEN
     $CompCode=1
     THEN 1
  END
  ELSE 1
END&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H3 id="toc-hId--525350720"&gt;Warning Message in task log&lt;/H3&gt;
&lt;P&gt;Warning message in the task logs:&lt;BR /&gt;"Table "Schema.Table" (Subtask 0 thread 1) is suspended. Cannot compute expression, not all column values are in the data record.&lt;/P&gt;
&lt;H3 id="toc-hId--525350720"&gt;Solution&lt;/H3&gt;
&lt;P&gt;As we were discussing this issue we realized that on a delete statement from the source the only fields that were in the journal were before image fields. There were no after image fields which would have the correct field name "$CompCode"&lt;/P&gt;
&lt;P&gt;When we changed the filter expression to use the before image field name it worked okay "$BI_CompCode" as the before image was included in the journal entry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp; There can be other reasons why a field that is referenced in an expression may not be in the journal or transaction log from the source. If you get an error message like this one you can help debug it by turning on the __CT tables&amp;nbsp;to see what they are receiving&amp;nbsp;from the source.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2022 18:31:28 GMT</pubDate>
    <dc:creator>Michael_Litz</dc:creator>
    <dc:date>2022-06-24T18:31:28Z</dc:date>
    <item>
      <title>Transformation: Source - Filter for Delete</title>
      <link>https://community.qlik.com/t5/Official-Support-Articles/Transformation-Source-Filter-for-Delete/ta-p/1947635</link>
      <description>&lt;P&gt;Replicate, Filter, Transformation, Expression&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2022 18:31:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Official-Support-Articles/Transformation-Source-Filter-for-Delete/ta-p/1947635</guid>
      <dc:creator>Michael_Litz</dc:creator>
      <dc:date>2022-06-24T18:31:28Z</dc:date>
    </item>
  </channel>
</rss>

