<?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 get the percent for the total charge column? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829381#M327683</link>
    <description>&lt;P&gt;ANY time you discuss percent, or other rates for that matter, you need to define what value is used for the numerator and what value is used for the denominator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So since I don't see anything clearly labeled as "total charge" I have no confidence what a percentage would be with that data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And do you want a data set, for further manipulation, or a report, for people to see?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A report &lt;STRONG&gt;might be:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=datain;
  var charge;
  class pt_class;
  table pt_class,
        charge*pctsum
  ;
run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 19 Aug 2022 15:40:59 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-08-19T15:40:59Z</dc:date>
    <item>
      <title>How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829379#M327681</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm curious how to get the percent for the total amount of in the 'Charge' column.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data dataIN;
   infile datalines dsd;
   input PT_class : $50.  Charge;
   datalines;
	ICU, 100,
	Lab, 200,
	Radiology, 300,
	PF fee, 500,
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829379#M327681</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2022-08-19T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829380#M327682</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table want as select
        pt_class
        ,charge
        ,100*charge/sum(charge) as percent
    from datain;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829380#M327682</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-19T15:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829381#M327683</link>
      <description>&lt;P&gt;ANY time you discuss percent, or other rates for that matter, you need to define what value is used for the numerator and what value is used for the denominator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So since I don't see anything clearly labeled as "total charge" I have no confidence what a percentage would be with that data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And do you want a data set, for further manipulation, or a report, for people to see?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A report &lt;STRONG&gt;might be:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=datain;
  var charge;
  class pt_class;
  table pt_class,
        charge*pctsum
  ;
run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829381#M327683</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-19T15:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829382#M327684</link>
      <description>&lt;P&gt;how about this code?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  create table want as
    select PT_class, Charge, round(charge/sum(Charge)*100,0.01) as perc 
    from dataIN
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829382#M327684</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-08-19T15:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829383#M327685</link>
      <description>I apologize for the confusion.  I would like to get the percent = each PT_class / sum(Charge) , is it that clear?</description>
      <pubDate>Fri, 19 Aug 2022 15:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829383#M327685</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2022-08-19T15:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the percent for the total charge column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829384#M327686</link>
      <description>&lt;P&gt;Alternative solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=datain;
    tables pt_class/out=want noprint;
    weight charge;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-the-percent-for-the-total-charge-column/m-p/829384#M327686</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-19T15:47:43Z</dc:date>
    </item>
  </channel>
</rss>

