<?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 (SQL?)  Add a &amp;quot;total row&amp;quot; for each group by combination in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152973#M40227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS communities,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database that has the population by 110 ages, 50 states and 2 sexes, meaning my database had 110x50x2 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create extra rows that would contain all the possible combinations for&amp;nbsp; "all ages combined ", "all states combied " and "both sexes"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new database would have 111x 51 x3 rows.&amp;nbsp;&amp;nbsp; Is there an easy way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2014 02:49:29 GMT</pubDate>
    <dc:creator>morglum</dc:creator>
    <dc:date>2014-12-17T02:49:29Z</dc:date>
    <item>
      <title>(SQL?)  Add a "total row" for each group by combination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152973#M40227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi SAS communities,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a database that has the population by 110 ages, 50 states and 2 sexes, meaning my database had 110x50x2 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to create extra rows that would contain all the possible combinations for&amp;nbsp; "all ages combined ", "all states combied " and "both sexes"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new database would have 111x 51 x3 rows.&amp;nbsp;&amp;nbsp; Is there an easy way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 02:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152973#M40227</guid>
      <dc:creator>morglum</dc:creator>
      <dc:date>2014-12-17T02:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: (SQL?)  Add a "total row" for each group by combination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152974#M40228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Storing total rows in a&amp;nbsp; database in not recommended. Have them calculated during report creation instead. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152974#M40228</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2014-12-17T03:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: (SQL?)  Add a "total row" for each group by combination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152975#M40229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am in the report creation phase, how would you proceed to generate all these lines?&lt;/P&gt;&lt;P&gt;I may be missing something obvious like a proc freq or tabulate.&lt;/P&gt;&lt;P&gt;I just want the output to be a sas7bdat file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:34:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152975#M40229</guid>
      <dc:creator>morglum</dc:creator>
      <dc:date>2014-12-17T03:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: (SQL?)  Add a "total row" for each group by combination</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152976#M40230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc TABULATE is the answer.&amp;nbsp; I was so focussed on thinking up a proc sql way that I forgot the obvious:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data= pop out=tabulated;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class age&amp;nbsp; sex state year ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var pop;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table (age all) * (sexe all) * (state all) * (year), weight=' ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2014 03:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Add-a-quot-total-row-quot-for-each-group-by-combination/m-p/152976#M40230</guid>
      <dc:creator>morglum</dc:creator>
      <dc:date>2014-12-17T03:54:48Z</dc:date>
    </item>
  </channel>
</rss>

