<?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 create a column where the value in each row is the sum of all values in another column? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677271#M23776</link>
    <description>&lt;P&gt;Thank you very much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;! That worked&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I am grateful for your quick help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karoline&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2020 15:24:12 GMT</pubDate>
    <dc:creator>KarolineN</dc:creator>
    <dc:date>2020-08-17T15:24:12Z</dc:date>
    <item>
      <title>How to create a column where the value in each row is the sum of all values in another column?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677265#M23773</link>
      <description>&lt;P&gt;Dear SAS community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would someone be so kind to help me with a small challenge? It is probably very simple, but being a beginner I have not been able to figure it out: I have a dataset with two columns (A and B) that very simplified looks something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;Cars&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;90&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Buses&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50&lt;/P&gt;&lt;P&gt;Planes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&lt;/P&gt;&lt;P&gt;Helicopters&amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I would like to create an additional column C, where the value in each row is the sum of all the values in column B, like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;C&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cars&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 90&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;152&lt;/P&gt;&lt;P&gt;Buses&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;152&lt;/P&gt;&lt;P&gt;Planes&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;152&lt;/P&gt;&lt;P&gt;Helicopters&amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;152&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your kind help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karoline&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 14:59:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677265#M23773</guid>
      <dc:creator>KarolineN</dc:creator>
      <dc:date>2020-08-17T14:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column where the value in each row is the sum of all values in another column?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677266#M23774</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 create table want as
 select *, sum(b) as c
 from your_dataset;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2020 15:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677266#M23774</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-08-17T15:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column where the value in each row is the sum of all values in another column?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677267#M23775</link>
      <description>&lt;P&gt;And if you may prefer a datastep instead-&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want;
 set your_dataset(in=t1) your_dataset(in=t2);
 if t1 then c+b;
 if t2;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Aug 2020 15:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677267#M23775</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-08-17T15:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a column where the value in each row is the sum of all values in another column?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677271#M23776</link>
      <description>&lt;P&gt;Thank you very much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;! That worked&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I am grateful for your quick help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Karoline&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 15:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-create-a-column-where-the-value-in-each-row-is-the-sum-of/m-p/677271#M23776</guid>
      <dc:creator>KarolineN</dc:creator>
      <dc:date>2020-08-17T15:24:12Z</dc:date>
    </item>
  </channel>
</rss>

