<?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: SAS EG Computed Column in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/866765#M42626</link>
    <description>&lt;P&gt;I use EG. You can dabble with the calculator, go to Advanced Functions and mess around with the functions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS_V_R_0-1680021235145.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82121iAAE0724DF3186351/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAS_V_R_0-1680021235145.png" alt="SAS_V_R_0-1680021235145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, Drag the variable column name into select, then press the calculator thing. and identify the variable from its "source column like 't1'. or something like that and make an input statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, find out if you can make a case statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2023 16:39:42 GMT</pubDate>
    <dc:creator>SAS_V_R</dc:creator>
    <dc:date>2023-03-28T16:39:42Z</dc:date>
    <item>
      <title>SAS EG Computed Column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/865917#M42600</link>
      <description>&lt;P&gt;I have the following dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;NAME&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;AMOUNT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;251717&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Better Inc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$5&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;251717&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Better Co&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$24&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;252534&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Pan Holdings&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$520&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;252534&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Pan Co&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$820&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;259169&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Province Inc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$300&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;259992&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;ABC Inc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$620&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way in SAS EG query builder to create a new computed column called NEWNAME that when IDs are the same, to take the Name with the most amount? So the output would look like this following:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;NEWNAME&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;&lt;STRONG&gt;AMOUNT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;251717&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Better Co&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$29&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;252534&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Pan Co&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$1,340&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;259169&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;Province Inc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$300&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="208"&gt;
&lt;P&gt;259992&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;ABC Inc&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="208"&gt;
&lt;P&gt;$620&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 12:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/865917#M42600</guid>
      <dc:creator>WorkUser</dc:creator>
      <dc:date>2023-03-23T12:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Computed Column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/865927#M42601</link>
      <description>&lt;P&gt;A little coding will be much easier than fiddling with the query builder:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by id descending amount;
run;

data want;
set have (rename=(name=_name amount=_amount));
by id;
retain name amount;
if first.id
then do;
  name = _name;
  amount = _amount;
end;
else amount + _amount;
if last.id;
drop _:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Mar 2023 13:17:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/865927#M42601</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-03-23T13:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG Computed Column</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/866765#M42626</link>
      <description>&lt;P&gt;I use EG. You can dabble with the calculator, go to Advanced Functions and mess around with the functions.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS_V_R_0-1680021235145.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/82121iAAE0724DF3186351/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAS_V_R_0-1680021235145.png" alt="SAS_V_R_0-1680021235145.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise, Drag the variable column name into select, then press the calculator thing. and identify the variable from its "source column like 't1'. or something like that and make an input statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, find out if you can make a case statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 16:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Computed-Column/m-p/866765#M42626</guid>
      <dc:creator>SAS_V_R</dc:creator>
      <dc:date>2023-03-28T16:39:42Z</dc:date>
    </item>
  </channel>
</rss>

