<?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: using SCD type 2 transformation with where condition in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801677#M20283</link>
    <description>You are very welcome and I am glad that this solution appears to be working.&lt;BR /&gt;I would just reiterate the recommendation for thorough testing of the solution.&lt;BR /&gt;&lt;BR /&gt;Cheers.</description>
    <pubDate>Fri, 11 Mar 2022 15:12:52 GMT</pubDate>
    <dc:creator>ChrisLysholm</dc:creator>
    <dc:date>2022-03-11T15:12:52Z</dc:date>
    <item>
      <title>using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801127#M20277</link>
      <description>&lt;P&gt;Hello Team ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any option with DIS&amp;nbsp; SCD type 2 transformation , to perform&amp;nbsp; this action only when it meets specific condition&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex: update the specific records as in below example&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we need to implement SCD type 2 transformation only for the dept =EEE for other department records , we need to keep as is .&lt;/P&gt;
&lt;P&gt;am using below configuration&lt;/P&gt;
&lt;P&gt;Here the business key is NAME and DEPT (we have unique records)&lt;/P&gt;
&lt;P&gt;detect changes in column&amp;nbsp;Score&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="1071"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="170"&gt;student_key&lt;/TD&gt;
&lt;TD width="64"&gt;Name&lt;/TD&gt;
&lt;TD width="204"&gt;dept&lt;/TD&gt;
&lt;TD width="197"&gt;Score&lt;/TD&gt;
&lt;TD width="142"&gt;change_ind&lt;/TD&gt;
&lt;TD width="191"&gt;change_start_dt&lt;/TD&gt;
&lt;TD width="103"&gt;change_end_dt&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;Student1&lt;/TD&gt;
&lt;TD&gt;EEE&lt;/TD&gt;
&lt;TD&gt;70&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;TD&gt;09/03/2022&lt;/TD&gt;
&lt;TD&gt;01/01/5000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;Student2&lt;/TD&gt;
&lt;TD&gt;EEE&lt;/TD&gt;
&lt;TD&gt;50&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;TD&gt;09/03/2022&lt;/TD&gt;
&lt;TD&gt;01/01/5000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;TD&gt;Student1&lt;/TD&gt;
&lt;TD&gt;CSC&lt;/TD&gt;
&lt;TD&gt;70&lt;/TD&gt;
&lt;TD&gt;Y&lt;/TD&gt;
&lt;TD&gt;09/03/2022&lt;/TD&gt;
&lt;TD&gt;01/01/5000&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Wed, 09 Mar 2022 16:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801127#M20277</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2022-03-09T16:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801166#M20278</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not aware of a specific option within the SCD Type 2 Loader transformation that would satisfy the requirement if I am understanding the problem correctly. However, a potential workaround that you could test for suitability would be to apply a filter to the source (incremental change data) that would result in outputting only those rows where dept=EEE. The pre-filtered source data would then be connected as an input (source) to the SCD Type 2 Loader. The SCD type 1/2 processing should then only produce insert/update rows that are specific to those rows where dept=EEE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please not, I have not tested this workaround. I would recommend thoroughly testing this workaround if you would be pursuing it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2022 18:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801166#M20278</guid>
      <dc:creator>ChrisLysholm</dc:creator>
      <dc:date>2022-03-09T18:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801670#M20282</link>
      <description>Thanks Chris, &lt;BR /&gt;It works in that way , if the  delta data is filtered for a specific condition here  dept=EEE. &lt;BR /&gt;and business key in SCD2 transformation business key is NAME and DEPT , only these rows get updated in the target table.&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Mar 2022 14:45:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801670#M20282</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2022-03-11T14:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801677#M20283</link>
      <description>You are very welcome and I am glad that this solution appears to be working.&lt;BR /&gt;I would just reiterate the recommendation for thorough testing of the solution.&lt;BR /&gt;&lt;BR /&gt;Cheers.</description>
      <pubDate>Fri, 11 Mar 2022 15:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/801677#M20283</guid>
      <dc:creator>ChrisLysholm</dc:creator>
      <dc:date>2022-03-11T15:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/803351#M20289</link>
      <description>Hello Chris ,&lt;BR /&gt;&lt;BR /&gt;As you said , this failed in testing phase.&lt;BR /&gt;&lt;BR /&gt;Means , the SCD type2 transformation captures the updates of delta and create new records if there is change.&lt;BR /&gt;But it closes all other records (change indicator) with out updating the start and end dates , which are not available in delta  as shown in below example.&lt;BR /&gt;&lt;BR /&gt;for example : &lt;BR /&gt;if the delta has below data &lt;BR /&gt;student_key	Name	dept	Score	&lt;BR /&gt;1	Student1	EEE       	40	    &lt;BR /&gt;                     &lt;BR /&gt;then the out put of the table result with SCD type 2 is &lt;BR /&gt; &lt;BR /&gt;student_key	Name	dept	Score	change_ind	change_start_dt	change_end_dt&lt;BR /&gt;1	Student1	EEE       	70	                           N	              09/03/2022	  22/03/2022&lt;BR /&gt;2	Student2	EEE	        50	                           N                09/03/2022	     01/01/5000&lt;BR /&gt;3	Student1	CSC	70	                          N	                09/03/2022	01/01/5000&lt;BR /&gt;4	Student1	EEE       	40	                          Y	             	  22/03/2022     01/01/5000&lt;BR /&gt; 	 	 	 	 	 	 &lt;BR /&gt;</description>
      <pubDate>Tue, 22 Mar 2022 14:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/803351#M20289</guid>
      <dc:creator>learn_SAS_23</dc:creator>
      <dc:date>2022-03-22T14:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: using SCD type 2 transformation with where condition</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/809830#M20304</link>
      <description>&lt;P&gt;From an architectural point of view, I cringe when you have different update methods for different rows in the same table.&lt;/P&gt;
&lt;P&gt;I sugest that you keep the table a pure SCD Type 2, and then if you have different requirement from a user perspective, create a view on top (or make an extract to another table) to hide history records for non EEE records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, there is an option "&lt;SPAN class="xis-windowItem"&gt;Close out records not in the source table&lt;/SPAN&gt;&lt;SPAN&gt;" that you can set to "No". And then add another Table Loader to load for non EEE records (Table laoder). This is just an idea, haven't tested myself.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 08:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/using-SCD-type-2-transformation-with-where-condition/m-p/809830#M20304</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2022-04-26T08:58:03Z</dc:date>
    </item>
  </channel>
</rss>

