<?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: How to compute a new column based on values in another column in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672204#M36526</link>
    <description>&lt;P&gt;Here's how to do it using the &lt;STRONG&gt;Query Builder&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;1. Locate your dataset. (Mine demo dataset is called MY_DATA, located in the WORK library).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_0-1595624481353.png" style="width: 121px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47647i952154ED6E39DF01/image-dimensions/121x45?v=v2" width="121" height="45" role="button" title="mklangley_0-1595624481353.png" alt="mklangley_0-1595624481353.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. Double-click on the dataset and then select&amp;nbsp;&lt;STRONG&gt;Query Builder&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_1-1595624586594.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47648iD7749A8936621512/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_1-1595624586594.png" alt="mklangley_1-1595624586594.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. Drag both columns (from the left) into the&amp;nbsp;&lt;STRONG&gt;Select Data &lt;/STRONG&gt;area&amp;nbsp;in the middle.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_3-1595624662340.png" style="width: 703px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47650iBD67C5CF63759E72/image-dimensions/703x326?v=v2" width="703" height="326" role="button" title="mklangley_3-1595624662340.png" alt="mklangley_3-1595624662340.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;4. Click the dropdown for BDTOT under&amp;nbsp;&lt;STRONG&gt;Summary&lt;/STRONG&gt;, and click SUM.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_2-1595624634790.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47649i92606477A3BBAB49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_2-1595624634790.png" alt="mklangley_2-1595624634790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;5. Click&amp;nbsp;&lt;STRONG&gt;Run&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using my data, here are the results I see:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_4-1595624794005.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47651iCC4A454367337074/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_4-1595624794005.png" alt="mklangley_4-1595624794005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 21:08:15 GMT</pubDate>
    <dc:creator>mklangley</dc:creator>
    <dc:date>2020-07-24T21:08:15Z</dc:date>
    <item>
      <title>How to compute a new column based on values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672175#M36520</link>
      <description>&lt;P&gt;I have a dataset of &amp;gt;2000 hospitals that contains the two variables (columns)&lt;/P&gt;&lt;P&gt;1. HRR Code (numeric code for hospital referral region that the hospital belongs to). There are 306 distinct HRR codes&lt;/P&gt;&lt;P&gt;2. BDTOT (Number of beds in each hospital)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to compute a new column that will show the number of beds in all hospitals in a particular HRR. Is there a conditional expression (possibly with a wildcard) that I can use to sum all the hospital beds for each instance of the 306 HRRs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for helping out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 20:04:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672175#M36520</guid>
      <dc:creator>goodyucee</dc:creator>
      <dc:date>2020-07-24T20:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute a new column based on values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672179#M36521</link>
      <description>&lt;P&gt;If you're just looking for the sum of BDTOT for each HRR_Code, then this should do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table want as
    select  HRR_Code, sum(BDTOT) as total_beds_by_hrr format comma8.
    from have
    group by HRR_Code;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 20:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672179#M36521</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-24T20:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute a new column based on values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672182#M36523</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223296"&gt;@mklangley&lt;/a&gt;. I am using Enterprise Guide here and I am a complete novice with programming.&lt;/P&gt;&lt;P&gt;Can you describe how I can compute the new column using the graphical interface of EG or the conditional expression that I have to type.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 20:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672182#M36523</guid>
      <dc:creator>goodyucee</dc:creator>
      <dc:date>2020-07-24T20:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute a new column based on values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672204#M36526</link>
      <description>&lt;P&gt;Here's how to do it using the &lt;STRONG&gt;Query Builder&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;1. Locate your dataset. (Mine demo dataset is called MY_DATA, located in the WORK library).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_0-1595624481353.png" style="width: 121px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47647i952154ED6E39DF01/image-dimensions/121x45?v=v2" width="121" height="45" role="button" title="mklangley_0-1595624481353.png" alt="mklangley_0-1595624481353.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;2. Double-click on the dataset and then select&amp;nbsp;&lt;STRONG&gt;Query Builder&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_1-1595624586594.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47648iD7749A8936621512/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_1-1595624586594.png" alt="mklangley_1-1595624586594.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. Drag both columns (from the left) into the&amp;nbsp;&lt;STRONG&gt;Select Data &lt;/STRONG&gt;area&amp;nbsp;in the middle.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_3-1595624662340.png" style="width: 703px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47650iBD67C5CF63759E72/image-dimensions/703x326?v=v2" width="703" height="326" role="button" title="mklangley_3-1595624662340.png" alt="mklangley_3-1595624662340.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;4. Click the dropdown for BDTOT under&amp;nbsp;&lt;STRONG&gt;Summary&lt;/STRONG&gt;, and click SUM.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_2-1595624634790.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47649i92606477A3BBAB49/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_2-1595624634790.png" alt="mklangley_2-1595624634790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;5. Click&amp;nbsp;&lt;STRONG&gt;Run&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using my data, here are the results I see:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mklangley_4-1595624794005.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47651iCC4A454367337074/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mklangley_4-1595624794005.png" alt="mklangley_4-1595624794005.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 21:08:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672204#M36526</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2020-07-24T21:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to compute a new column based on values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672209#M36527</link>
      <description>&lt;P&gt;Thanks so much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/223296"&gt;@mklangley&lt;/a&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 21:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-compute-a-new-column-based-on-values-in-another-column/m-p/672209#M36527</guid>
      <dc:creator>goodyucee</dc:creator>
      <dc:date>2020-07-24T21:25:18Z</dc:date>
    </item>
  </channel>
</rss>

