<?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 Calculated Field based off a report output in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Calculated-Field-based-off-a-report-output/m-p/609782#M76730</link>
    <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file that lists out individual holdings by 2 managers. I successfully created a summarized report of total holding by each manager using the code below: However, I actually need the summarized figure from this report in other calculations. Because it is a "report", I wasn't sure how I can call on the summarized field within.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to do is say "this manager currently holds $10,000 in apple, and divide that $10,000 by the summarized total from the report to get a % of total column".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=temp.tsndata1;&lt;BR /&gt;columns mgrno fdate shareprice;&lt;BR /&gt;define mgrno/group;&lt;BR /&gt;define fdate/group;&lt;BR /&gt;define shareprice/analysis sum;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Dec 2019 19:33:02 GMT</pubDate>
    <dc:creator>anweinbe</dc:creator>
    <dc:date>2019-12-05T19:33:02Z</dc:date>
    <item>
      <title>Calculated Field based off a report output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculated-Field-based-off-a-report-output/m-p/609782#M76730</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a file that lists out individual holdings by 2 managers. I successfully created a summarized report of total holding by each manager using the code below: However, I actually need the summarized figure from this report in other calculations. Because it is a "report", I wasn't sure how I can call on the summarized field within.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am trying to do is say "this manager currently holds $10,000 in apple, and divide that $10,000 by the summarized total from the report to get a % of total column".&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=temp.tsndata1;&lt;BR /&gt;columns mgrno fdate shareprice;&lt;BR /&gt;define mgrno/group;&lt;BR /&gt;define fdate/group;&lt;BR /&gt;define shareprice/analysis sum;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 19:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculated-Field-based-off-a-report-output/m-p/609782#M76730</guid>
      <dc:creator>anweinbe</dc:creator>
      <dc:date>2019-12-05T19:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Field based off a report output</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Calculated-Field-based-off-a-report-output/m-p/609814#M76731</link>
      <description>&lt;P&gt;See if this helps helps.&lt;/P&gt;
&lt;PRE&gt;proc report data=temp.tsndata1;
columns mgrno fdate shareprice,(sum pctsum);
define mgrno/group;
define fdate/group;
define shareprice/analysis;
run;&lt;/PRE&gt;
&lt;P&gt;The comma after shareprice indicates that you want to "nest" results and requesting multiple statistics.&lt;/P&gt;
&lt;P&gt;Or you can use alias&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc report data=temp.tsndata1; 
   columns mgrno fdate shareprice shareprice=sharepctsum; 
   define mgrno/group; 
   define fdate/group; 
   define shareprice/analysis sum; 
   define sharepctsum / analysis pctsum;
run;&lt;/PRE&gt;
&lt;P&gt;To get more precise suggestions you would need to provide example data and perhaps expected numbers hand worked from the results of your current report.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 22:06:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Calculated-Field-based-off-a-report-output/m-p/609814#M76731</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-12-05T22:06:12Z</dc:date>
    </item>
  </channel>
</rss>

