<?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: Help with simple SQL Join expression in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117853#M1402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just map it twice in the job diagram, the second mapping prompts you for specifying an alias.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Jan 2013 10:12:19 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2013-01-08T10:12:19Z</dc:date>
    <item>
      <title>Help with simple SQL Join expression</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117850#M1399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working in an SQL Join transformation in DI Studio, I need an expression which says that "All fields in this column should have the same value as the field where Current=1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only the rows with Current=1 has "disability_flag" filled out, and I need to copy it to those with Current=0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In example, this input table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;PK&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Disability_Flag&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Current&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should become this output table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;PK&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Disability_Flag&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Current&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason I can't think of what expression to use. I'd appreciate any advice, thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 08:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117850#M1399</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-01-08T08:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Help with simple SQL Join expression</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117851#M1400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Join the table onto itself (aliases lets say a and b), on PK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mapping:&lt;/P&gt;&lt;P&gt;b.disability_flg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;P&gt;b.current = '1'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 09:19:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117851#M1400</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-01-08T09:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with simple SQL Join expression</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117852#M1401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Linus. I know how to join tables to themselves if I can drag-and-drop them from the folders menu into the SQL Join "Create" window, but in this case the input table is a previous SQL Join. How can I make a copy of it in the DI Studio SQL Join Create window?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="2901" alt="Skjermbilde.PNG" class="jive-image" src="https://communities.sas.com/legacyfs/online/2901_Skjermbilde.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had hoped to resolve the problem another way. So far I've been grouping by the PK and used expressions to select for example the min(ValidFrom_DTTM) and max(ValidTo_DTTM) to combine 2-3 rows into one. My aim is that the combined row should have the most updated/current disability_flag value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 10:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117852#M1401</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-01-08T10:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with simple SQL Join expression</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117853#M1402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just map it twice in the job diagram, the second mapping prompts you for specifying an alias.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 10:12:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117853#M1402</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-01-08T10:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with simple SQL Join expression</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117854#M1403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, now all the other pieces fell into place as well. Thank you. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 10:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Help-with-simple-SQL-Join-expression/m-p/117854#M1403</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2013-01-08T10:21:16Z</dc:date>
    </item>
  </channel>
</rss>

