<?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: Recalculate summary data in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871549#M26269</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408238"&gt;@ikoba&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you should define &lt;FONT face="courier new,courier"&gt;p_medta&lt;/FONT&gt; as a computed variable, not as an analysis variable:&lt;/P&gt;
&lt;PRE&gt;define p_medta / &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;computed&lt;/STRONG&gt;&lt;/FONT&gt; format=10.2 style(header)=[background=CXD9E1F2];&lt;/PRE&gt;
&lt;P&gt;Then insert this formula into the existing COMPUTE block for &lt;FONT face="courier new,courier"&gt;p_medta&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;p_medta=round((medta&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;/(medta&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;+medtra&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;+vrc&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;))*100,0.01);&lt;/PRE&gt;
&lt;P&gt;The compound variable names (of the form &lt;EM&gt;&lt;FONT face="courier new,courier"&gt;variablename.statistic&lt;/FONT&gt;&lt;/EM&gt;) are necessary because &lt;FONT face="courier new,courier"&gt;medta&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;medtra&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;vrc&lt;/FONT&gt; are &lt;EM&gt;analysis&lt;/EM&gt; variables and &lt;FONT face="courier new,courier"&gt;sum&lt;/FONT&gt; is their default statistic.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2023 11:57:52 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2023-04-24T11:57:52Z</dc:date>
    <item>
      <title>Recalculate summary data</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871525#M26267</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I would like to ask you about a problem:&lt;/P&gt;&lt;P&gt;I have a dataset with study, site, approved_terms, approval_requiring,requiring_coding, percent_terms approved&lt;/P&gt;&lt;P&gt;percent_terms approved was calculated as&amp;nbsp;approved_terms/(approved_terms+approval_requiring+requiring_coding)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a summary row on site and study level.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I do not know how to recalculate the&amp;nbsp;percent_terms approved field on summary rows accourding to the formula, as it is an average in the summery row, which is not correct.&lt;/P&gt;&lt;P&gt;I have attached the aoutput in excel.&lt;/P&gt;&lt;P&gt;The code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value fcolor&lt;BR /&gt;0 - 75 = 'red'&lt;BR /&gt;75 - 95 = 'orange'&lt;BR /&gt;95 - 1000 = 'green';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;ods excel file="z:\Studies\UCAB-CT-05\DM\Output\Status\DRS\Regular\aaa_&amp;amp;sysdate9..xlsx" ;&lt;BR /&gt;ods excel options(autofilter="1-70" sheet_name = "DRS" embedded_titles='yes');&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc report data = ds.drs nowd;&lt;BR /&gt;columns study site subject medta medtra vrc p_medta ;&lt;BR /&gt;define study/group ;&lt;BR /&gt;define site/group ;&lt;/P&gt;&lt;P&gt;/*p_medta=round((medta/(medta+medtra+vrc))*100,0.01);*/&lt;BR /&gt;define medta / style(header)=[background=CXD9E1F2];&lt;BR /&gt;define medtra / style(header)=[background=CXD9E1F2];&lt;BR /&gt;define vrc / style(header)=[background=CXD9E1F2];&lt;BR /&gt;define p_medta / ANALYSIS&lt;BR /&gt;MEAN&lt;BR /&gt;FORMAT=10.2&lt;BR /&gt;style(header)=[background=CXD9E1F2];&lt;/P&gt;&lt;P&gt;compute p_medta;&lt;BR /&gt;call define&lt;BR /&gt;(_col_,'style',"STYLE=[BACKGROUND=fcolor.]");&lt;BR /&gt;endcomp;&lt;BR /&gt;break after site / skip summarize style=[background=CXF2F2F2 font_weight=bold];&lt;BR /&gt;break after study / skip summarize style=[background=CXFFFFCC font_weight=bold];&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;ods excel close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 10:48:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871525#M26267</guid>
      <dc:creator>ikoba</dc:creator>
      <dc:date>2023-04-24T10:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Recalculate summary data</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871531#M26268</link>
      <description>&lt;P&gt;Most of us would like to help, but we cannot make use of Excel files. Many simply refuse to download Excel files as they can be security threats.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide us data by following these instructions:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/," target="_blank"&gt;https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/,&lt;/A&gt;&amp;nbsp;or type the data in as&amp;nbsp;&lt;STRONG&gt;working&amp;nbsp;&lt;/STRONG&gt;SAS data step code yourself. We don't need the entire data set, a portion of the data will do fine, as long as the data allows us to understand the problem and code it properly.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 11:27:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871531#M26268</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-24T11:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Recalculate summary data</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871549#M26269</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/408238"&gt;@ikoba&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you should define &lt;FONT face="courier new,courier"&gt;p_medta&lt;/FONT&gt; as a computed variable, not as an analysis variable:&lt;/P&gt;
&lt;PRE&gt;define p_medta / &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;computed&lt;/STRONG&gt;&lt;/FONT&gt; format=10.2 style(header)=[background=CXD9E1F2];&lt;/PRE&gt;
&lt;P&gt;Then insert this formula into the existing COMPUTE block for &lt;FONT face="courier new,courier"&gt;p_medta&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;p_medta=round((medta&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;/(medta&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;+medtra&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;+vrc&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;.sum&lt;/STRONG&gt;&lt;/FONT&gt;))*100,0.01);&lt;/PRE&gt;
&lt;P&gt;The compound variable names (of the form &lt;EM&gt;&lt;FONT face="courier new,courier"&gt;variablename.statistic&lt;/FONT&gt;&lt;/EM&gt;) are necessary because &lt;FONT face="courier new,courier"&gt;medta&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;medtra&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;vrc&lt;/FONT&gt; are &lt;EM&gt;analysis&lt;/EM&gt; variables and &lt;FONT face="courier new,courier"&gt;sum&lt;/FONT&gt; is their default statistic.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 11:57:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871549#M26269</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-04-24T11:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Recalculate summary data</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871553#M26270</link>
      <description>&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 12:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Recalculate-summary-data/m-p/871553#M26270</guid>
      <dc:creator>ikoba</dc:creator>
      <dc:date>2023-04-24T12:07:16Z</dc:date>
    </item>
  </channel>
</rss>

