<?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: NOTE: The query requires remerging summary statistics back with the original data. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510274#M137334</link>
    <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select age
        ,sum(case when Sex='F' then Weight else . end) as Weight_F
        ,sum(case when Sex='M' then Weight else . end) as Weight_M 
  from sashelp.class
  group by 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Nov 2018 20:46:37 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-11-04T20:46:37Z</dc:date>
    <item>
      <title>NOTE: The query requires remerging summary statistics back with the original data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510273#M137333</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to summaries data contained in sashelp.class using PROC SQL to a report similar (column headers might be different but information contained should match) to the below output generated from PROC REPORT:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2018-11-04 at 20.36.31.png" style="width: 144px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24634i5B124C57DFB9AF2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2018-11-04 at 20.36.31.png" alt="Screenshot 2018-11-04 at 20.36.31.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script I have written is this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select &lt;BR /&gt;     age, &lt;BR /&gt;     case when Sex='F' then sum(Weight) else . end as Weight_Femal, &lt;BR /&gt;     case when Sex='M' then sum(weight) else . end as Weight_Male
from sashelp.class
group by 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, this generates the error message:&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2018-11-04 at 20.38.54.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24635i20B6DE4D192352B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2018-11-04 at 20.38.54.png" alt="Screenshot 2018-11-04 at 20.38.54.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know what the error is, but in this case i dont know how to correct it. Can anyone help please?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 20:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510273#M137333</guid>
      <dc:creator>frupaul</dc:creator>
      <dc:date>2018-11-04T20:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE: The query requires remerging summary statistics back with the original data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510274#M137334</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select age
        ,sum(case when Sex='F' then Weight else . end) as Weight_F
        ,sum(case when Sex='M' then Weight else . end) as Weight_M 
  from sashelp.class
  group by 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 20:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510274#M137334</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-11-04T20:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: NOTE: The query requires remerging summary statistics back with the original data.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510283#M137340</link>
      <description>&lt;P&gt;You cam also write this as:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select AGE
        ,sum((SEX='F') * WEIGHT) as WEIGHT_F
        ,sum((SEX='M') * WEIGHT) as WEIGHT_M
  from SASHELP.CLASS
  group by 1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Nov 2018 22:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/NOTE-The-query-requires-remerging-summary-statistics-back-with/m-p/510283#M137340</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-11-04T22:30:17Z</dc:date>
    </item>
  </channel>
</rss>

