<?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 How to add a calculated column of data into an existing table/dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725219#M28057</link>
    <description>&lt;P&gt;I have created a table that contains all of the columns/variables that I need into one table from excel sheets. I need to add 1-3 more columns that have calculated values from the values of a few of the variables/columns in the table. I have looked everywhere but nothing is working the way I need it to. for reference, this is the data table I am working with that needs to have an extra column in it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55786i9ABDABEFA3652DB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.45.46 PM.png" alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I want is to have a final column in the end called "total billing" that includes the calculated values [price * quantity * (1-discount)&amp;nbsp; * (1+tax rate) ] and I thought I could do that at once but in my query builder it does not allow me to type in numbers for the 1-discount and the 1+tax rate, so I think I have to make separate columns for both of those and then combine the 4 columns at the end in the query to make the final computed column. however, I cannot figure out how to make the 1-discount column (want to be called 'discount rate') or the 1+tax rate column (want to be called 'taxed') to be added to this overall table in order to get to the final computed column. Let me know if any more information is needed. For reference, this is what my query builder looks like when I press 'build column'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55787iA685B41F9A01BF5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.50.21 PM.png" alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;... i have seen online some videos on how to do a computed column in query builder but none of those look like my SAS 9.4 screen and tool bar in any way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55788i96B501746B6752A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.52.25 PM.png" alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 17:53:34 GMT</pubDate>
    <dc:creator>bb123</dc:creator>
    <dc:date>2021-03-10T17:53:34Z</dc:date>
    <item>
      <title>How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725219#M28057</link>
      <description>&lt;P&gt;I have created a table that contains all of the columns/variables that I need into one table from excel sheets. I need to add 1-3 more columns that have calculated values from the values of a few of the variables/columns in the table. I have looked everywhere but nothing is working the way I need it to. for reference, this is the data table I am working with that needs to have an extra column in it.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55786i9ABDABEFA3652DB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.45.46 PM.png" alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I want is to have a final column in the end called "total billing" that includes the calculated values [price * quantity * (1-discount)&amp;nbsp; * (1+tax rate) ] and I thought I could do that at once but in my query builder it does not allow me to type in numbers for the 1-discount and the 1+tax rate, so I think I have to make separate columns for both of those and then combine the 4 columns at the end in the query to make the final computed column. however, I cannot figure out how to make the 1-discount column (want to be called 'discount rate') or the 1+tax rate column (want to be called 'taxed') to be added to this overall table in order to get to the final computed column. Let me know if any more information is needed. For reference, this is what my query builder looks like when I press 'build column'&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55787iA685B41F9A01BF5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.50.21 PM.png" alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;... i have seen online some videos on how to do a computed column in query builder but none of those look like my SAS 9.4 screen and tool bar in any way.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55788i96B501746B6752A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.52.25 PM.png" alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 17:53:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725219#M28057</guid>
      <dc:creator>bb123</dc:creator>
      <dc:date>2021-03-10T17:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725225#M28058</link>
      <description>&lt;P&gt;First of all, please provide your data in usable form, namely in a data step with datalines. We cannot write code for pictures.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 18:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725225#M28058</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-10T18:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725233#M28059</link>
      <description>&lt;P&gt;I understand that code cannot be written for pictures, but the dataset is too big to attach here - it won't allow it. I was hoping that someone could put in a reply what the code to do what I am asking for should look like/contain, if that makes sense. for example,&lt;/P&gt;&lt;P&gt;proc ___&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;or if something else needs to be done to describe it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 18:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725233#M28059</guid>
      <dc:creator>bb123</dc:creator>
      <dc:date>2021-03-10T18:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725237#M28060</link>
      <description>&lt;P&gt;For developing code, a representative subset is enough (about what's contained in your picture, but usable). That usually needs no more than 50 lines of DATALINES code.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 18:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725237#M28060</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-10T18:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725263#M28061</link>
      <description>&lt;P&gt;Here is some of the dataset&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 20:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725263#M28061</guid>
      <dc:creator>bb123</dc:creator>
      <dc:date>2021-03-10T20:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a calculated column of data into an existing table/dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725266#M28062</link>
      <description>&lt;P&gt;I think you just need the advanced computed column then you can type in a formula and not rely on the builder. It's much easier that way in my opinion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use a basic data step as follows, assuming you have the 4 variables in your data set. If you don't, create them before between the SET and TOTAL_BILLING statements.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;

total_billing = price*quantity * (1-discount) * (1+ tax_rate);

run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/373323"&gt;@bb123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have created a table that contains all of the columns/variables that I need into one table from excel sheets. I need to add 1-3 more columns that have calculated values from the values of a few of the variables/columns in the table. I have looked everywhere but nothing is working the way I need it to. for reference, this is the data table I am working with that needs to have an extra column in it.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55786i9ABDABEFA3652DB8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.45.46 PM.png" alt="Screen Shot 2021-03-10 at 12.45.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What I want is to have a final column in the end called "total billing" that includes the calculated values [price * quantity * (1-discount)&amp;nbsp; * (1+tax rate) ] and I thought I could do that at once but in my query builder it does not allow me to type in numbers for the 1-discount and the 1+tax rate, so I think I have to make separate columns for both of those and then combine the 4 columns at the end in the query to make the final computed column. however, I cannot figure out how to make the 1-discount column (want to be called 'discount rate') or the 1+tax rate column (want to be called 'taxed') to be added to this overall table in order to get to the final computed column. Let me know if any more information is needed. For reference, this is what my query builder looks like when I press 'build column'&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55787iA685B41F9A01BF5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.50.21 PM.png" alt="Screen Shot 2021-03-10 at 12.50.21 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;... i have seen online some videos on how to do a computed column in query builder but none of those look like my SAS 9.4 screen and tool bar in any way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55788i96B501746B6752A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-03-10 at 12.52.25 PM.png" alt="Screen Shot 2021-03-10 at 12.52.25 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 21:16:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-add-a-calculated-column-of-data-into-an-existing-table/m-p/725266#M28062</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-10T21:16:25Z</dc:date>
    </item>
  </channel>
</rss>

