<?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: Table Joins in Guide 5.1 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268525#M18599</link>
    <description>&lt;P&gt;Although you can do the lookups in SQL, do you really want the overhead of carrying those labels as part of a new data set?&amp;nbsp; Have you considered using PROC FORMAT to label the results?&amp;nbsp; You can use the contents of the lookup table to generate formats and then just link them when needed.&amp;nbsp; There is an example of doing that in the PROC FORMAT documentation.&amp;nbsp; It is also often quicker than the SQL-only aproach.&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2016 14:05:56 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2016-05-05T14:05:56Z</dc:date>
    <item>
      <title>Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268502#M18598</link>
      <description>&lt;P&gt;Database desgn has a lookup table&amp;nbsp;that I need to join against to translate&amp;nbsp;values from the primary&amp;nbsp;data tables.&amp;nbsp; So in SQL I Would do this&amp;nbsp;by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Select b.value_desc as 'Status',&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.variable2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a.variable3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From variable_table a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" size="2"&gt;LEFT&lt;/FONT&gt; &lt;FONT color="#808080" size="2"&gt;JOIN&lt;/FONT&gt; &lt;FONT color="#ff00ff" size="2"&gt;lookup&lt;/FONT&gt;&lt;FONT size="2"&gt;&amp;nbsp;b &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;on&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; a.&lt;/FONT&gt;&lt;FONT size="2"&gt;lookup_status&lt;/FONT&gt;&lt;FONT color="#808080" size="2"&gt;&lt;FONT color="#808080" size="2"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; b&lt;/FONT&gt;&lt;FONT color="#808080" size="2"&gt;&lt;FONT color="#808080" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;column_value &lt;/FONT&gt;&lt;FONT color="#808080" size="2"&gt;&lt;FONT color="#808080" size="2"&gt;and&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt; b&lt;/FONT&gt;&lt;FONT color="#808080" size="2"&gt;&lt;FONT color="#808080" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;column_name &lt;/FONT&gt;&lt;FONT color="#808080" size="2"&gt;&lt;FONT color="#808080" size="2"&gt;=&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#ff0000" size="2"&gt;&lt;FONT color="#ff0000" size="2"&gt;'lookup_status'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000" size="2"&gt;&lt;FONT color="#ff0000" size="2"&gt;Lookup Table&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;column_value&lt;/TD&gt;&lt;TD&gt;column_name&lt;/TD&gt;&lt;TD&gt;value_desc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;lookup_status&lt;/TD&gt;&lt;TD&gt;Open&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;lookup_status&lt;/TD&gt;&lt;TD&gt;Closed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;lookup_status&lt;/TD&gt;&lt;TD&gt;Pending&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if the value was 1 in the data table I would get back Open,when &amp;nbsp;2 Closed etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a bunch of work completed already in project mode and I know there is a way to do this in Guide using the query builder tables and joins in combination with an advanced expression, could not find an example in the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added Complexity&lt;/P&gt;&lt;P&gt;Within the data table there may 3 or 4 lookup values, can I do multiple joins to the lookup table for each&amp;nbsp;lookup&amp;nbsp;value?&amp;nbsp; In SQL I'd have to rejoin to the lookup table&amp;nbsp;for each variable against which I wanted&amp;nbsp;value_desc returned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 13:07:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268502#M18598</guid>
      <dc:creator>RickyS</dc:creator>
      <dc:date>2016-05-05T13:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268525#M18599</link>
      <description>&lt;P&gt;Although you can do the lookups in SQL, do you really want the overhead of carrying those labels as part of a new data set?&amp;nbsp; Have you considered using PROC FORMAT to label the results?&amp;nbsp; You can use the contents of the lookup table to generate formats and then just link them when needed.&amp;nbsp; There is an example of doing that in the PROC FORMAT documentation.&amp;nbsp; It is also often quicker than the SQL-only aproach.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 14:05:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268525#M18599</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2016-05-05T14:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268540#M18600</link>
      <description>&lt;P&gt;Proc Format is a possible solution and I have done that if and when the data table values are stable and I don't need to complete too many lookup joins.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For this data set some of the&amp;nbsp;data values will be changing over time so&amp;nbsp;I really do need to join to the tables to ensure the&amp;nbsp;final output will always reflect the updated values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, have been asked to build out in project mode so the less technical can gain a better perspective on the data aggregation through a conversation using the project window as the visualization tool.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 14:22:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268540#M18600</guid>
      <dc:creator>RickyS</dc:creator>
      <dc:date>2016-05-05T14:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268549#M18601</link>
      <description>&lt;P&gt;Need some clarification regarding the variables in each table.The logic so far is: &amp;nbsp;when&amp;nbsp;&amp;nbsp;a.lookup_status=1 and a.lookup_status=b.column_value and b.column_name='lookup_status' then 'Status'=b.value_description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what do you mean when writing Within the data table there may be 3 or 4 lookup values? &amp;nbsp;Which table a/b is the data table? &amp;nbsp;What variable in which table may have 3 or 4 look values. &amp;nbsp;Are these look values evaluated against another table.variable?&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 14:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268549#M18601</guid>
      <dc:creator>thorneton</dc:creator>
      <dc:date>2016-05-05T14:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268562#M18603</link>
      <description>&lt;P&gt;The database has around 100 primary data tables and 1 lookup table,&amp;nbsp;each of the 100 data tables&amp;nbsp;may have 20 - 30 variables of which &amp;nbsp;4 - 5 require translating by joining to the lookup table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you can use a Case statement in&amp;nbsp;SQL, Proc Format in SAS to translate or&amp;nbsp;Table join on the variable Name to the Lookup table to extract the translated value which&amp;nbsp;is 'value_desc'.&amp;nbsp;&amp;nbsp;Pros and cons to each approach depending upon what you are doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simplified Perspective of a Data&amp;nbsp;Table&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Variable Name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;table_id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;primary_key&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;secondary_id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;lookup_status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;lookup_type_of_client&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;lookup_client_company_structure&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Lookup_client_business_volume&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_17&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;other_variable_18&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 14:55:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268562#M18603</guid>
      <dc:creator>RickyS</dc:creator>
      <dc:date>2016-05-05T14:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268593#M18605</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67527"&gt;@RickyS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Proc Format is a possible solution and I have done that if and when the data table values are stable and I don't need to complete too many lookup joins.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this data set some of the&amp;nbsp;data values will be changing over time so&amp;nbsp;I really do need to join to the tables to ensure the&amp;nbsp;final output will always reflect the updated values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, have been asked to build out in project mode so the less technical can gain a better perspective on the data aggregation through a conversation using the project window as the visualization tool.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I have a project that adds values at least monthly. I find it worth while to periodically examine the data and update formats, several are multilabel formats, because it makes the report writing later much easier. If these values change over time, who updates the lookup table(s) you would be using? An update to that table could trigger an update to the format. &lt;/P&gt;
&lt;P&gt;Just a thought.&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2016 16:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/268593#M18605</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-05-05T16:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/269759#M18693</link>
      <description>&lt;P&gt;put a ticket in with tech support yesterday&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 15:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/269759#M18693</guid>
      <dc:creator>RickyS</dc:creator>
      <dc:date>2016-05-11T15:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Table Joins in Guide 5.1</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/278663#M19235</link>
      <description>&lt;P&gt;Per usual&amp;nbsp;the answer is pretty straight forward&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;QueryBuilder&amp;gt; Join Tables&amp;gt; Join Properties&amp;gt; Edit&amp;gt; code for the value you want returned&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May vary slightly&amp;nbsp;if your Options are not set to automatically&amp;nbsp;choose the join variable &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 13:20:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Table-Joins-in-Guide-5-1/m-p/278663#M19235</guid>
      <dc:creator>RickyS</dc:creator>
      <dc:date>2016-06-20T13:20:23Z</dc:date>
    </item>
  </channel>
</rss>

